MCPcopy Create free account
hub / github.com/aws/smithy-go / decodeJSONString

Method decodeJSONString

document/json/decoder.go:274–286  ·  view source on GitHub ↗
(tv string, rv reflect.Value)

Source from the content-addressed store, hash-verified

272}
273
274func (d *Decoder) decodeJSONString(tv string, rv reflect.Value) error {
275 switch rv.Kind() {
276 case reflect.String:
277 rv.SetString(tv)
278 case reflect.Interface:
279 // Ensure type aliasing is handled properly
280 rv.Set(reflect.ValueOf(tv).Convert(rv.Type()))
281 default:
282 return &document.UnmarshalTypeError{Value: "string", Type: rv.Type()}
283 }
284
285 return nil
286}
287
288func (d *Decoder) decodeJSONObject(tv map[string]interface{}, rv reflect.Value) error {
289 switch rv.Kind() {

Callers 1

decodeMethod · 0.95

Calls 2

TypeMethod · 0.80
SetMethod · 0.45

Tested by

no test coverage detected