MCPcopy Create free account
hub / github.com/alecthomas/kong / jsonTranscode

Function jsonTranscode

mapper.go:956–965  ·  view source on GitHub ↗
(in, out any)

Source from the content-addressed store, hash-verified

954}
955
956func jsonTranscode(in, out any) error {
957 data, err := json.Marshal(in)
958 if err != nil {
959 return err
960 }
961 if err = json.Unmarshal(data, out); err != nil {
962 return fmt.Errorf("%#v -> %T: %v", in, out, err)
963 }
964 return nil
965}

Callers 3

PopValueIntoMethod · 0.85
mapDecoderFunction · 0.85
sliceDecoderFunction · 0.85

Calls 1

ErrorfMethod · 0.80

Tested by

no test coverage detected