summaryrefslogtreecommitdiff
path: root/cmd/podman/images/mount.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman/images/mount.go')
-rw-r--r--cmd/podman/images/mount.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/cmd/podman/images/mount.go b/cmd/podman/images/mount.go
index a098aac63..3a38a7a19 100644
--- a/cmd/podman/images/mount.go
+++ b/cmd/podman/images/mount.go
@@ -3,8 +3,6 @@ package images
import (
"fmt"
"os"
- "text/tabwriter"
- "text/template"
"github.com/containers/common/pkg/report"
"github.com/containers/podman/v3/cmd/podman/common"
@@ -99,13 +97,18 @@ func mount(cmd *cobra.Command, args []string) error {
mrs = append(mrs, mountReporter{r})
}
- row := "{{range . }}{{.ID}}\t{{.Path}}\n{{end}}"
- tmpl, err := template.New("mounts").Parse(row)
+ row := "{{range . }}{{.ID}}\t{{.Path}}\n{{end -}}"
+ tmpl, err := report.NewTemplate("mounts").Parse(row)
+ if err != nil {
+ return err
+ }
+
+ w, err := report.NewWriterDefault(os.Stdout)
if err != nil {
return err
}
- w := tabwriter.NewWriter(os.Stdout, 8, 2, 2, ' ', 0)
defer w.Flush()
+
return tmpl.Execute(w, mrs)
}