Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/apexskier/go-template-validation
Visual, web based go template validation
https://github.com/apexskier/go-template-validation
go golang template tool validation
Last synced: about 2 months ago
JSON representation
Visual, web based go template validation
- Host: GitHub
- URL: https://github.com/apexskier/go-template-validation
- Owner: apexskier
- Created: 2020-03-01T16:14:59.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-09-26T15:33:01.000Z (about 3 years ago)
- Last Synced: 2024-04-14T19:20:29.825Z (8 months ago)
- Topics: go, golang, template, tool, validation
- Language: Go
- Homepage: https://camlittle.com/go-template-validation
- Size: 61.5 KB
- Stars: 14
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go template validation
When working with the [`"text/template"`](https://golang.org/pkg/text/template/) and [`"html/template"`](https://golang.org/pkg/html/template/) packages, I often have a hard time understanding go's errors, especially when they're inline in code. This is a simple tool to visually show where validation errors are happening.
To use, choose a file or insert your template code directly. You can add mock data in the form of JSON.
## Features
* Show errors at the relavent line/character
* Recovery from unknown function errors
* Recovery from missing value for command errors
* Some auto-handling of required data
* Discover character position of misunderstood tokens## Goals
* Find as many issues as possible. The default package bails out at the first error (which makes sense at runtime), but often you'll fix one error only to have to track down the next.
* (at this point) Don't rewrite/maintain a fork of [`"text/template/parse"`](https://golang.org/pkg/text/template/parse/)