mapstructure icon indicating copy to clipboard operation
mapstructure copied to clipboard

Go library for decoding generic map values into native Go structures and vice versa.

Results 84 mapstructure issues
Sort by recently updated
recently updated
newest added

Is there a way to set a transformation function for before decoding? ``` DecodeHook: func(from reflect.Kind, to reflect.Kind, v interface{}) (interface{}, error) { fmt.Println(from, to) if from == reflect.String &&...

```go type Order struct { Id string } type User struct { Id string Order Order `mapstructure:",squash"` } result := map[string]interface{}{} mapstructure.Decode(User{ Id: "userId", Order: Order{ Id: "orderId", }, },...

I have a need to have multiple tags like this: ClientId string `json:"clientId" mapstructure:"uuid","clientId"` Is that possible? Am I doing wrong? Because it´s not working

Hello, I want to decode the values from a struct to another struct, it works for all primitive datatypes but not for custom types like the Foobar example which uses...