mapstructure
mapstructure copied to clipboard
Go library for decoding generic map values into native Go structures and vice versa.
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 ```...
 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...