INNER CODE UNIT · Go
latestPatchOfMinor
werf/nelm · scripts/schemagen/main.go:397
func latestPatchOfMinor(dirSHAs map[string]string, minor string) (string, error) {
var (
latest string
latestPatch = -1
)
for dirName := range dirSHAs {
major, dirMinor, patch, err := parseKubernetesVersionDirName(dirName)
if err != nil {
continue
}
if fmt.Sprintf("%d.%d", major, dirMinor) != minor || patch <= latestPatch {
continue
}
latest, latestPatch = fmt.Sprintf("%d.%d.%d", major, dirMinor, patch), patch
}