MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / DoMapStructure

Function DoMapStructure

pkg/util/utilfn/marshal.go:45–55  ·  view source on GitHub ↗

does a mapstructure using "json" tags

(out any, input any)

Source from the content-addressed store, hash-verified

43
44// does a mapstructure using "json" tags
45func 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
57func MapToStruct(in map[string]any, out any) error {
58 // Check that out is a pointer

Callers 2

convertComplexFunction · 0.92
ParseWSCommandMapFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected