MCPcopy Create free account
hub / github.com/google/pprof / EncodeJSON

Function EncodeJSON

internal/proftest/proftest.go:70–77  ·  view source on GitHub ↗

EncodeJSON encodes a value into a byte array. This is intended for testing purposes.

(x interface{})

Source from the content-addressed store, hash-verified

68// EncodeJSON encodes a value into a byte array. This is intended for
69// testing purposes.
70func EncodeJSON(x interface{}) []byte {
71 data, err := json.MarshalIndent(x, "", " ")
72 if err != nil {
73 panic(err)
74 }
75 data = append(data, '\n')
76 return data
77}
78
79// TestUI implements the plugin.UI interface, triggering test failures
80// if more than Ignore errors not matching AllowRx are printed.

Callers 1

TestMarshalUnmarshalFunction · 0.92

Calls

no outgoing calls

Tested by 1

TestMarshalUnmarshalFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…