Documentation
¶
Overview ¶
Package position maps text/template error positions back to the source file of a template that was rendered from derived text (re-serialized YAML or protected placeholders).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Remap ¶
Remap makes the position in a template error refer to the source file when the text that text/template parsed differs from it. The failing template action is located in the parsed text and in the source: when it can be tied to exactly one evaluated source location, the position is rewritten to that location; otherwise the position is removed, because a wrong position sends the user to an unrelated line.
Types ¶
type Texts ¶
type Texts struct {
// Source is the file as written.
Source string
// Input is the text passed to the renderer: the source, or the YAML re-serialized from it for an import with a
// context (keys sorted, comments dropped).
Input string
// Parsed is the text text/template parsed: input after protection replaced auth, YAML literal, Starlark and
// encoded-literal sections with placeholders. Error positions refer to it.
Parsed string
}
Texts are the versions of a template involved in rendering it.