mirror of
https://github.com/containers/skopeo.git
synced 2025-06-22 12:58:07 +00:00
Fix tabelating output in (skopeo inspect --format)
tabwriter buffers lines that contain \t in memory, and only writes them out on a .Flush(). So actually call that. Without this, things like > --format 'name\tdigest\tlabels\n{{.Name}}\t{{.Digest}}\t{{.Labels}}\n' result in no output at all. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
parent
d833619740
commit
1c3d49f012
@ -246,5 +246,8 @@ func printTmpl(stdout io.Writer, row string, data []any) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
w := tabwriter.NewWriter(stdout, 8, 2, 2, ' ', 0)
|
w := tabwriter.NewWriter(stdout, 8, 2, 2, ' ', 0)
|
||||||
return t.Execute(w, data)
|
if err := t.Execute(w, data); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return w.Flush()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user