Reject a standalone weight on key presence, whatever its value

This commit is contained in:
M
2026-08-28 00:39:49 +02:00
committed by lilleman-tw
parent 48cadd6c4d
commit 16f91503b0
3 changed files with 5 additions and 7 deletions
+1 -1
View File
@@ -144,7 +144,7 @@ func checkTokens(format string, fields map[string]node) error {
}
if _, ok := fields[name]; !ok {
if isOption(name) {
return fmt.Errorf("token {%s}: %q is an option, never a field", t.body, name)
return fmt.Errorf("token {%s}: %q is an option and can never be a field", t.body, name)
}
return fmt.Errorf("token {%s}: no field %q", t.body, name)
}