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

As the title says, when trying to decode a pointer of a pointer of any supported type to a map, mapstructure returns an error saying `'' expected a map, got...

Structs in slices were simply copyed to the target map. With this PR they can also be mapped, using the "deep" tag, or the global "Deep" option. Partially solves #249

According to [this ](https://github.com/mitchellh/mapstructure/issues/53#issuecomment-273342420)comment, encoding should be the arguments reversed. However, the mapstructure annotations are lost and it's not correctly encoded. Example: https://go.dev/play/p/m1pPpDYYMED The expected output should have been ```...

![image](https://github.com/mitchellh/mapstructure/assets/43395989/5d1b25a4-6c28-406f-ab61-2edbe09a9e60) This is a common function for create a item with given `model` and `dto`. The issue is summarized like the following: - `data` has type of `interface{} | dto.CreateDeliveryOrderDTO`...

Fix issue #288. Temporary: how to support this feature in your env ```bash $ go mod edit -replace=github.com/mitchellh/[email protected]=github.com/kamilsk/mapstructure@4650365 ``` Tested with `viper` and `pflag` https://github.com/octomation/maintainer/blob/dbfaab2b34ba9d2363d3e665b20c8bb5783581b1/internal/config/tool_test.go#L40-L87

The simplest way I can re-do it is below. It causes a panic [1] ``` package main import ( "fmt" "github.com/mitchellh/mapstructure" ) type Foo struct { B [2][]byte } func...

process bytes more efficiently

It's very difficult to tell how I should be using decoder hooks (or even whether they're applicable to my use case) when the documentation doesn't include any examples of how...

Thank you for this great package! A very handy additional feature could be the support of custom fields. A good proposal could be Unmarshalers interfaces (credit goes to encoding/json proposal...