FormatInspectSlice formats inspect results and propagates template errors back to the caller so CLI commands can fail with a non-zero exit code.
(format string, writer io.Writer, x []interface{})
| 81 | // FormatInspectSlice formats inspect results and propagates template errors back |
| 82 | // to the caller so CLI commands can fail with a non-zero exit code. |
| 83 | func FormatInspectSlice(format string, writer io.Writer, x []interface{}) error { |
| 84 | if len(x) == 0 { |
| 85 | return nil |
| 86 | } |
| 87 | return FormatSlice(format, writer, x) |
| 88 | } |
| 89 | |
| 90 | func tryRawFormat(b *bytes.Buffer, f interface{}, tmpl *template.Template) error { |
| 91 | m, err := json.MarshalIndent(f, "", " ") |
searching dependent graphs…