Convert a node to a shortened JSON for easier debugging
(node *yaml.Node)
| 160 | |
| 161 | // Convert a node to a shortened JSON for easier debugging |
| 162 | func ToSJson(node *yaml.Node) string { |
| 163 | if node == nil { |
| 164 | return "nil" |
| 165 | } |
| 166 | j, err := json.MarshalIndent(makeSNode(node), "", " ") |
| 167 | if err != nil { |
| 168 | return fmt.Sprintf("Failed to marshal node to short json: %v:", err) |
| 169 | } |
| 170 | return string(j) |
| 171 | } |
| 172 | |
| 173 | // Convert a node to JSON |
| 174 | func ToJson(node *yaml.Node) string { |