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

Method Label

cmd/formatter/container.go:250–255  ·  view source on GitHub ↗

Label returns the value of the label with the given name or an empty string if the given label does not exist.

(name string)

Source from the content-addressed store, hash-verified

248// Label returns the value of the label with the given name or an empty string
249// if the given label does not exist.
250func (c *ContainerContext) Label(name string) string {
251 if c.c.Labels == nil {
252 return ""
253 }
254 return c.c.Labels[name]
255}
256
257// Mounts returns a comma-separated string of mount names present on the container.
258// If the trunc option is set, names can be truncated (ellipsized).

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected