MCPcopy Index your code
hub / github.com/docker/cli / TruncateID

Function TruncateID

cli/command/formatter/displayutils.go:35–37  ·  view source on GitHub ↗

TruncateID returns a shorthand version of a string identifier for presentation, after trimming digest algorithm prefix (if any). This function is a wrapper for [stringid.TruncateID] for convenience.

(id string)

Source from the content-addressed store, hash-verified

33//
34// This function is a wrapper for [stringid.TruncateID] for convenience.
35func TruncateID(id string) string {
36 return stringid.TruncateID(id)
37}
38
39// Ellipsis truncates a string to fit within maxDisplayWidth, and appends ellipsis (…).
40// For maxDisplayWidth of 1 and lower, no ellipsis is appended.

Callers 8

TestTruncateIDFunction · 0.85
IDMethod · 0.85
TestImageContextFunction · 0.85
TestContainerPsContextFunction · 0.85
IDMethod · 0.85
ParentMethod · 0.85
IDMethod · 0.85
ImageMethod · 0.85

Calls

no outgoing calls

Tested by 3

TestTruncateIDFunction · 0.68
TestImageContextFunction · 0.68
TestContainerPsContextFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…