You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I propose to add a new flag fig.UseStrict, when set fig.Load will return an error upon encountering unknown (i.e: extra) fields.
For example. given:
---
log_level: debughost: "0.0.0.0"
typeConfigstruct {
Hoststring`fig:"host"`LogLevelstring`fig:"logLevel"`
}
varcfgServerfig.Load(&cfg, UseStrict()) // Returns error because the key `log_level` is unknown
The text was updated successfully, but these errors were encountered:
It would be nice to have something akin to json.DisallowUnknownFields and yaml.UnmarshalStrict to catch configuration invalid configurations earlier and make them an error.
I propose to add a new flag
fig.UseStrict
, when setfig.Load
will return an error upon encountering unknown (i.e: extra) fields.For example. given:
The text was updated successfully, but these errors were encountered: