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

Method Key

encoding/json/object.go:27–35  ·  view source on GitHub ↗

Key adds the given named key to the JSON object. Returns a Value encoder that should be used to encode a JSON value type.

(name string)

Source from the content-addressed store, hash-verified

25// Returns a Value encoder that should be used to encode
26// a JSON value type.
27func (o *Object) Key(name string) Value {
28 if o.writeComma {
29 o.w.WriteRune(comma)
30 } else {
31 o.writeComma = true
32 }
33 o.writeKey(name)
34 return newValue(o.w, o.scratch)
35}
36
37// Close encodes the end of the JSON Object
38func (o *Object) Close() {

Callers 7

TestEncoderFunction · 0.80
TestValueFunction · 0.80
TestObjectFunction · 0.80
TestObjectKey_escapedFunction · 0.80
decodeMapMethod · 0.80
decodeJSONObjectMethod · 0.80
GetValueMethod · 0.80

Calls 3

writeKeyMethod · 0.95
newValueFunction · 0.70
WriteRuneMethod · 0.65

Tested by 4

TestEncoderFunction · 0.64
TestValueFunction · 0.64
TestObjectFunction · 0.64
TestObjectKey_escapedFunction · 0.64