cli icon indicating copy to clipboard operation
cli copied to clipboard

templates: make "join" work with non-string slices and map values

Open thaJeztah opened this issue 6 months ago • 1 comments

  • relates to https://github.com/docker/cli/pull/2733

Add a custom join function that allows for non-string slices to be joined, following the same rules as "fmt.Sprint", it will use the fmt.Stringer interface if implemented, or "error" if the type has an "Error()".

For maps, it joins the map-values, for example:

docker image inspect --format '{{join .Config.Labels ", "}}' ubuntu
24.04, ubuntu

- What I did

- How I did it

- How to verify it

- Human readable description for the release notes



- A picture of a cute animal (not mandatory but encouraged)

thaJeztah avatar Aug 25 '25 14:08 thaJeztah

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests.

:loudspeaker: Thoughts on this report? Let us know!

codecov-commenter avatar Aug 25 '25 14:08 codecov-commenter