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

Function buildCacheSort

cli/command/formatter/buildcache.go:54–70  ·  view source on GitHub ↗
(buildCache []build.CacheRecord)

Source from the content-addressed store, hash-verified

52}
53
54func buildCacheSort(buildCache []build.CacheRecord) {
55 sort.Slice(buildCache, func(i, j int) bool {
56 lui, luj := buildCache[i].LastUsedAt, buildCache[j].LastUsedAt
57 switch {
58 case lui == nil && luj == nil:
59 return strings.Compare(buildCache[i].ID, buildCache[j].ID) < 0
60 case lui == nil:
61 return true
62 case luj == nil:
63 return false
64 case lui.Equal(*luj):
65 return strings.Compare(buildCache[i].ID, buildCache[j].ID) < 0
66 default:
67 return lui.Before(*luj)
68 }
69 })
70}
71
72// BuildCacheWrite renders the context for a list of containers
73func BuildCacheWrite(ctx Context, buildCaches []build.CacheRecord) error {

Callers 2

BuildCacheWriteFunction · 0.85
verboseWriteMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…