ToJSON converts a single YAML document into a JSON document or returns an error. If the document appears to be JSON the YAML decoding path is not used (so that error messages are JSON specific).
(data []byte)
| 33 | // YAML decoding path is not used (so that error messages are |
| 34 | // JSON specific). |
| 35 | func ToJSON(data []byte) ([]byte, error) { |
| 36 | if hasJSONPrefix(data) { |
| 37 | return data, nil |
| 38 | } |
| 39 | return yaml.YAMLToJSON(data) |
| 40 | } |
| 41 | |
| 42 | // YAMLToJSONDecoder decodes YAML documents from an io.Reader by |
| 43 | // separating individual documents. It first converts the YAML |
nothing calls this directly
no test coverage detected