Spend the struct cap on embedded structs too, word it for any struct field, and route path advice through the name check
Tests / vet + fmt + tests (pull_request) Successful in 1m2s
Tests / vet + fmt + tests (push) Successful in 6s

This commit was merged in pull request #14.
This commit is contained in:
2026-09-15 17:50:42 +02:00
parent c212c6bef4
commit 3cd3f8f317
4 changed files with 47 additions and 18 deletions
+10
View File
@@ -396,6 +396,16 @@ func checkName(name string) error {
return nil
}
// checkPathNames rejects a dotted path with a segment no name may be.
func checkPathNames(path string) error {
for _, seg := range strings.Split(path, ".") {
if err := checkName(seg); err != nil {
return fmt.Errorf("path %w", err)
}
}
return nil
}
// isOption reports whether a template key configures the node instead of naming a
// field. These names can never be fields.
func isOption(name string) bool {