Skip to content

Commit 150a25b

Browse files
committed
image/tree: Extract untagged image name to const
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
1 parent 67f5e34 commit 150a25b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cli/command/image/tree.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import (
2222
"github.com/opencontainers/go-digest"
2323
)
2424

25+
const untaggedName = "<untagged>"
26+
2527
type treeOptions struct {
2628
images []imagetypes.Summary
2729
all bool
@@ -433,7 +435,7 @@ func printChildren(out tui.Output, headers []imgColumn, img topImage, normalColo
433435

434436
func printNames(out tui.Output, headers []imgColumn, img topImage, color, untaggedColor aec.ANSI) {
435437
if len(img.Names) == 0 {
436-
_, _ = fmt.Fprint(out, headers[0].Print(untaggedColor, "<untagged>"))
438+
_, _ = fmt.Fprint(out, headers[0].Print(untaggedColor, untaggedName))
437439
}
438440

439441
for nameIdx, name := range img.Names {

0 commit comments

Comments
 (0)