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

Function jsonTranscode

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

Source from the content-addressed store, hash-verified

964}
965
966func jsonTranscode(in, out any) error {
967 data, err := json.Marshal(in)
968 if err != nil {
969 return err
970 }
971 if err = json.Unmarshal(data, out); err != nil {
972 return fmt.Errorf("%#v -> %T: %v", in, out, err)
973 }
974 return nil
975}

Callers 3

PopValueIntoMethod · 0.85
mapDecoderFunction · 0.85
sliceDecoderFunction · 0.85

Calls 1

ErrorfMethod · 0.80

Tested by

no test coverage detected