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
What bothers me with this solution is that I have to take the copy paste the default configuration chosen by koanf into my code and tweak it locally.
As a user of the API, this is one of several associated bugs I tripped over. The others being:
As seen in the excerpt below, if arg c.DecoderConfig is set to non-nil, 'o' is ignored; the caller must instead pass in a pointer through the Result field.
The above is undocumented, users must download and read the koanf source.
The comment's reference to mitchellh/mapstructure is stale; a newer fork is now linked in, and must be located to obtain authoritative info on the semantics of ErrorUnused.
koanf.go-// UnmarshalWithConf is like Unmarshal but takes configuration params in UnmarshalConf.
koanf.go-// See mitchellh/mapstructure's DecoderConfig for advanced customization
koanf.go-// of the unmarshal behaviour.
koanf.go-func (ko *Koanf) UnmarshalWithConf(path string, o interface{}, c UnmarshalConf) error {
koanf.go- if c.DecoderConfig == nil {
koanf.go: c.DecoderConfig = &mapstructure.DecoderConfig{
koanf.go- DecodeHook: mapstructure.ComposeDecodeHookFunc(
koanf.go- mapstructure.StringToTimeDurationHookFunc(),
koanf.go- textUnmarshalerHookFunc()),
koanf.go- Metadata: nil,
koanf.go- Result: o,
koanf.go- WeaklyTypedInput: true,
koanf.go- }
koanf.go- }
koanf.go-
The text was updated successfully, but these errors were encountered:
Referring to #189:
As a user of the API, this is one of several associated bugs I tripped over. The others being:
c.DecoderConfig
is set to non-nil,'o'
is ignored; the caller must instead pass in a pointer through theResult
field.koanf
source.mitchellh/mapstructure
is stale; a newer fork is now linked in, and must be located to obtain authoritative info on the semantics ofErrorUnused
.The text was updated successfully, but these errors were encountered: