🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

github.com/apexskier/go-template-validation

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/apexskier/go-template-validation

v0.0.0-20210926153258-987052adb1d2
Source
Go
Version published
Created
Source

Go template validation

When working with the "text/template" and "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.

Go template validator - example output

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"

FAQs

Package last updated on 26 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts