MCPcopy Create free account
hub / github.com/docker/cli / MarshalJSON

Function MarshalJSON

cli/command/formatter/reflect.go:16–22  ·  view source on GitHub ↗

MarshalJSON marshals x into json It differs a bit from encoding/json MarshalJSON function for formatter

(x any)

Source from the content-addressed store, hash-verified

14// MarshalJSON marshals x into json
15// It differs a bit from encoding/json MarshalJSON function for formatter
16func MarshalJSON(x any) ([]byte, error) {
17 m, err := marshalMap(x)
18 if err != nil {
19 return nil, err
20 }
21 return json.Marshal(m)
22}
23
24// marshalMap marshals x to map[string]any
25func marshalMap(x any) (map[string]any, error) {

Callers 9

MarshalJSONMethod · 0.85
MarshalJSONMethod · 0.85
MarshalJSONMethod · 0.85
MarshalJSONMethod · 0.85
MarshalJSONMethod · 0.85
MarshalJSONMethod · 0.85
MarshalJSONMethod · 0.85
MarshalJSONMethod · 0.85
MarshalJSONMethod · 0.85

Calls 1

marshalMapFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…