Say which input errors in IsTemplate, and which columns wait for the first draw

This commit is contained in:
2026-09-30 21:52:57 +02:00
committed by Lillem4n
parent 4fb81a5672
commit a24f52a1f0
2 changed files with 10 additions and 10 deletions
+5 -5
View File
@@ -49,11 +49,11 @@ func (f *Generator) FakeTemplate(input string) (string, error) {
return t.Fake(), nil
}
// IsTemplate reports whether arg is an inline template rather than a path, by its shape: a {
// token, or a JSON object, array or string, is a template, and anything else is a path. An
// arg that is not valid JSON errors where it holds a } or a quote, or starts with [, since no
// path may; so do a template of one reference alone, which is a path written as a template,
// and a path written with a leading /.
// IsTemplate reports whether arg is an inline template rather than a path, by its shape: an
// arg holding a {, or a valid JSON array or string, is a template, and anything else is a
// path. A path errors where it holds a } or a quote, starts with [, or is no valid path; so
// do a template of one reference alone, which is a path written as a template, and a path
// written with a leading /.
func IsTemplate(arg string) (bool, error) {
inline, err := isTemplate(arg)
if err != nil {