INNER CODE UNIT · Go
main
projectcontour/contour · hack/actions/bump-go-version/main.go:53
func main() {
log.SetFormatter(&logrus.TextFormatter{ForceColors: true})
currentVersion := getCurrentGoVersion()
// releaseTrack is the Go major or minor version to track, e.g. "1.25".
var releaseTrack string
if len(os.Args) < 2 {
// If no argument is given, derive the release track from the current minor version.
releaseTrack = currentVersion[:strings.LastIndex(currentVersion, ".")]
} else {
releaseTrack = os.Args[1]
}
log.Infof("Current Go version: %s", currentVersion)
latestVersion := getLatestGoVersionByReleaseTrack(releaseTrack)
log.Infof("Latest version: %s", latestVersion)