Documentation ¶
Index ¶
Constants ¶
View Source
const BGRed = 41
BGRed red color of background
View Source
const FGRed = 31
FGRed red color of text
Variables ¶
This section is empty.
Functions ¶
func CountDigits ¶
CountDigits returns the number of digits in a decimal number
func ErrorDetails ¶
func ErrorDetails(text string, errs []TemplateError) string
ErrorDetails constructs errors as a single string which shows where validation errors are happening.
func PrintErrorDetails ¶
func PrintErrorDetails(text string, errs []TemplateError)
PrintErrorDetails prints error details
func SplitLines ¶
SplitLines splits a string into lines Supports windows or unix line segments
Types ¶
type TemplateError ¶
type TemplateError struct { Line int Char int Description string Level ErrorLevel }
TemplateError describes the details of template error.
func CreateTemplateError ¶
func CreateTemplateError(err error, level ErrorLevel) TemplateError
CreateTemplateError parse and return a template error.
func Exec ¶
func Exec(t *textTemplate.Template, data interface{}, buf *bytes.Buffer) []TemplateError
Exec applies a parsed template to the specified data object
func Validate ¶
func Validate(text string) (*textTemplate.Template, []TemplateError)
Validate validates a template
Click to show internal directories.
Click to hide internal directories.