MCPcopy
hub / github.com/grpc/grpc-go / MarshalJSON

Method MarshalJSON

attributes/attributes.go:154–156  ·  view source on GitHub ↗

MarshalJSON helps implement the json.Marshaler interface, thereby rendering the Attributes correctly when printing (via pretty.JSON) structs containing Attributes as fields. Is it impossible to unmarshal attributes from a JSON representation and this method is meant only for debugging purposes.

()

Source from the content-addressed store, hash-verified

152// Is it impossible to unmarshal attributes from a JSON representation and this
153// method is meant only for debugging purposes.
154func (a *Attributes) MarshalJSON() ([]byte, error) {
155 return []byte(a.String()), nil
156}
157
158// all returns an iterator that yields all key-value pairs in the Attributes
159// chain. If a key appears multiple times, only the most recently added value

Callers 2

ServiceConfigJSONMethod · 0.45
LoadBalancingConfigMethod · 0.45

Calls 1

StringMethod · 0.95

Tested by

no test coverage detected