MCPcopy Create free account
hub / github.com/aws-cloudformation/rain / ToJson

Function ToJson

internal/node/node.go:174–180  ·  view source on GitHub ↗

Convert a node to JSON

(node *yaml.Node)

Source from the content-addressed store, hash-verified

172
173// Convert a node to JSON
174func ToJson(node *yaml.Node) string {
175 j, err := json.MarshalIndent(node, "", " ")
176 if err != nil {
177 return fmt.Sprintf("Failed to marshal node to json: %v:", err)
178 }
179 return string(j)
180}
181
182// Convert a node to a YAML string for troubleshooting
183func YamlStr(node *yaml.Node) string {

Callers 4

CheckRDSDBClusterFunction · 0.92
predictResourceArnFunction · 0.92
pkg.goFile · 0.92
formatStringFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected