ToJSON return a string with the JSON representation of the interface{} https://github.com/docker/compose/blob/v2/cmd/formatter/json.go#L31C4-L39
(i interface{}, prefix string, indentation string)
| 186 | // ToJSON return a string with the JSON representation of the interface{} |
| 187 | // https://github.com/docker/compose/blob/v2/cmd/formatter/json.go#L31C4-L39 |
| 188 | func ToJSON(i interface{}, prefix string, indentation string) (string, error) { |
| 189 | buffer := &bytes.Buffer{} |
| 190 | encoder := json.NewEncoder(buffer) |
| 191 | encoder.SetEscapeHTML(false) |
| 192 | encoder.SetIndent(prefix, indentation) |
| 193 | err := encoder.Encode(i) |
| 194 | return buffer.String(), err |
| 195 | } |
no test coverage detected
searching dependent graphs…