Convert a node to JSON
(node *yaml.Node)
| 172 | |
| 173 | // Convert a node to JSON |
| 174 | func 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 |
| 183 | func YamlStr(node *yaml.Node) string { |
no outgoing calls
no test coverage detected