MCPcopy Create free account
hub / github.com/docker/compose / Names

Method Names

cmd/formatter/container.go:154–165  ·  view source on GitHub ↗

Names returns a comma-separated string of the container's names, with their slash (/) prefix stripped. Additional names for the container (related to the legacy `--link` feature) are omitted.

()

Source from the content-addressed store, hash-verified

152// slash (/) prefix stripped. Additional names for the container (related to the
153// legacy `--link` feature) are omitted.
154func (c *ContainerContext) Names() string {
155 names := formatter.StripNamePrefix(c.c.Names)
156 if c.trunc {
157 for _, name := range names {
158 if len(strings.Split(name, "/")) == 1 {
159 names = []string{name}
160 break
161 }
162 }
163 }
164 return strings.Join(names, ",")
165}
166
167func (c *ContainerContext) Service() string {
168 return c.c.Service

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected