decode is a wrapper around mapstructure.Decode that mimics the WeakDecode functionality.
(input any, config *mapstructure.DecoderConfig)
| 1023 | |
| 1024 | // decode is a wrapper around mapstructure.Decode that mimics the WeakDecode functionality. |
| 1025 | func decode(input any, config *mapstructure.DecoderConfig) error { |
| 1026 | decoder, err := mapstructure.NewDecoder(config) |
| 1027 | if err != nil { |
| 1028 | return err |
| 1029 | } |
| 1030 | return decoder.Decode(input) |
| 1031 | } |
| 1032 | |
| 1033 | // UnmarshalExact unmarshals the config into a Struct, erroring if a field is nonexistent |
| 1034 | // in the destination struct. |
no test coverage detected