Reject options that cannot take effect, and skip entries that are not data
This commit is contained in:
@@ -143,6 +143,9 @@ func checkTokens(format string, fields map[string]node) error {
|
||||
continue // a root reference; its target is checked at New (see linkRefs)
|
||||
}
|
||||
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}: no field %q", t.body, name)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user