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

I would like to be able to build the target struct that decode maps into across different contributing pieces that are only stitched together at runtime. My approach for doing...

When using this library with ComposeDecodeHook we noticed some performance degration. After further investigation, it seems that a lot of time is spent inside typedDecodeHook on reflect func. I think...

```go package main import ( "log" "github.com/mitchellh/mapstructure" ) func main() { o := struct { String []byte `json:"bytes"` }{} cfg := &mapstructure.DecoderConfig{ DecodeHook: mapstructure.ComposeDecodeHookFunc( mapstructure.StringToSliceHookFunc(","), ), Metadata: nil, Result: &o,...

In my case , ı'm using mongodb driver. In this model "SecondId" decoded correctly but "ID" doesn't decode it would be 000000000000 because "ID" bson starts with lower case letter...

Hi I have Jason field `k8s_version` which contain underscore. However I have noticed that I am not able to decode values with _. Just wondering if its a bug or...

If a field is a slice of structs they are not decoded, instead it stays a slice of that type. Same goes for maps. [See example here.](https://play.golang.org/p/x4dU5xzGCIH)

enhancement

When i try decode a map[string]interface {} into stuct the error return "Source data must be an array or slice, got string". This is the code : ``` func main()...

If I'm not mistaken, the `main.go` below should output: ```yaml sub_config: first_children: - name: parent grand_children: - name: foo - name: bar ``` Instead, it is outputting: ```yaml sub_config: first_children:...

Struct format ``` type ( Specification struct { Environment Templates } Environment struct { Build image.Image Runtime image.Image } Templates struct { ArtifactPathTemplate string `mapstructure:"artifact-path"` StartCommandTemplate *executable.TemplateCommand `mapstructure:"start-command"` ComponentInstallationTemplate *executable.TemplateCommand...