MCPcopy
hub / github.com/canopy-network/canopy / MarshalJSONIndentString

Function MarshalJSONIndentString

lib/util.go:472–477  ·  view source on GitHub ↗

MarshalJSONIndentString() serializes a message into an indented JSON string

(message any)

Source from the content-addressed store, hash-verified

470
471// MarshalJSONIndentString() serializes a message into an indented JSON string
472func MarshalJSONIndentString(message any) (string, ErrorI) {
473 // convert the message to pretty json bytes
474 bz, err := MarshalJSONIndent(message)
475 // convert to string and exit
476 return string(bz), err
477}
478
479// NewJSONFromFile() reads a json file into an object
480func NewJSONFromFile(o any, dataDirPath, filePath string) ErrorI {

Callers 7

debugDumpHeaderDiffMethod · 0.92
TestTFunction · 0.92
TestRLPToSendTxEtherscanFunction · 0.92
TestRLPToSendTxDynamicFunction · 0.92
TestRLPToSendTxERC20Function · 0.92
TestRLPStakingFunction · 0.92
writeToConsoleFunction · 0.92

Calls 1

MarshalJSONIndentFunction · 0.85

Tested by 5

TestTFunction · 0.74
TestRLPToSendTxEtherscanFunction · 0.74
TestRLPToSendTxDynamicFunction · 0.74
TestRLPToSendTxERC20Function · 0.74
TestRLPStakingFunction · 0.74