MCPcopy Create free account
hub / github.com/containerd/nerdctl / FormatInspectSlice

Function FormatInspectSlice

pkg/formatter/common.go:83–88  ·  view source on GitHub ↗

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{})

Source from the content-addressed store, hash-verified

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.
83func 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
90func tryRawFormat(b *bytes.Buffer, f interface{}, tmpl *template.Template) error {
91 m, err := json.MarshalIndent(f, "", " ")

Callers 5

InspectFunction · 0.92
inspectActionFunction · 0.92
imageInspectActionFunction · 0.92
inspectActionFunction · 0.92
TestFormatInspectSliceFunction · 0.85

Calls 1

FormatSliceFunction · 0.85

Tested by 1

TestFormatInspectSliceFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…