MCPcopy
hub / github.com/docker/docker-agent / scanHighestVN

Function scanHighestVN

lint/configpath.go:63–78  ·  view source on GitHub ↗
(dir string)

Source from the content-addressed store, hash-verified

61var highestCache sync.Map
62
63func scanHighestVN(dir string) int {
64 entries, err := os.ReadDir(dir)
65 if err != nil {
66 return -1
67 }
68 highest := -1
69 for _, e := range entries {
70 if !e.IsDir() {
71 continue
72 }
73 if n, ok := versionFromDir(e.Name()); ok && n > highest {
74 highest = n
75 }
76 }
77 return highest
78}

Callers 1

highestSiblingVersionFunction · 0.85

Calls 2

versionFromDirFunction · 0.85
NameMethod · 0.65

Tested by

no test coverage detected