mapstructure
mapstructure copied to clipboard
Go library for decoding generic map values into native Go structures and vice versa.
@mitchellh doesn't have time to maintain this project and plans to archive it. https://github.com/mitchellh/mapstructure/issues/172 https://github.com/mitchellh/mapstructure/pull/328#issuecomment-1858922295 @sagikazarmark (Viper contributor, https://github.com/spf13/viper/graphs/contributors) shows interest to create fork under an umbrella of Viper project....
When decoding, a nested struct could be squashed with the `mapstructure:",squash"` struct tag. A similar functionality appears when marshalling JSON into structs, but it is called `inline` instead of `squash`....
Hey, everyone! I still can reproduce the problem with decoding the embedded pointer from this [issue](https://github.com/mitchellh/mapstructure/issues/267). Here is the code to reproduce the problem: Expected result: `map[B:map[Name:]]` Actual result: `map[B:0x14000132000]`...
When the destination of a decode implements the custom decoder interface, use said interface. Custom decoders take precedence over the default decoding rules. This should resolve https://github.com/mitchellh/mapstructure/issues/115 Renamed the master...
Hello, I need to decode the a JSON supposed to be the type (`ProxyTransport`) from the `frp` project: https://github.com/fatedier/frp/blob/v0.52.3/pkg/config/v1/proxy.go#L40 Its field `BandwidthLimit` is expected to be of type `types.BandwidthQuantity`. But...
type Person struct { Name string `json:"name"` Age int `json:"age"` Time time.Time `json:"time"` Address Address `json:"address"` } Why a time.Time type has to be converted to map, not recursive transfer...
If I use `ErrorUnset = true` and add ``mapstructure:"-"`` to my struct field, I get the following error: ``` * '' has unset fields: - ``` But since that field...
# Motivation [Issue](https://github.com/mitchellh/mapstructure/issues/279) #279 reported by @kszafran # Changes Check in `decode struct -> map` for extra fields encoded with `remain` tag, and flatten in resultant map. Add corresponding tests:...