does a mapstructure using "json" tags
(out any, input any)
| 43 | |
| 44 | // does a mapstructure using "json" tags |
| 45 | func DoMapStructure(out any, input any) error { |
| 46 | dconfig := &mapstructure.DecoderConfig{ |
| 47 | Result: out, |
| 48 | TagName: "json", |
| 49 | } |
| 50 | decoder, err := mapstructure.NewDecoder(dconfig) |
| 51 | if err != nil { |
| 52 | return err |
| 53 | } |
| 54 | return decoder.Decode(input) |
| 55 | } |
| 56 | |
| 57 | func MapToStruct(in map[string]any, out any) error { |
| 58 | // Check that out is a pointer |
no outgoing calls
no test coverage detected