From 73c43e5b740b61d88b64f8691838747cff9bdf2d Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Fri, 23 Oct 2020 00:10:11 +0100 Subject: [PATCH] hack/update: golang version --- hack/update/golang_version/update_golang_version.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hack/update/golang_version/update_golang_version.go b/hack/update/golang_version/update_golang_version.go index 0e88b0debc..464b8f8852 100644 --- a/hack/update/golang_version/update_golang_version.go +++ b/hack/update/golang_version/update_golang_version.go @@ -34,6 +34,7 @@ import ( "time" "k8s.io/klog/v2" + "k8s.io/minikube/hack/update" ) @@ -87,13 +88,13 @@ var ( }, } - // pull request data + // PR data prBranchPrefix = "update-golang-version_" // will be appended with first 7 characters of the PR commit SHA - prTitle = `update_golang_version: {stable:"{{.StableVersion}}"}` + prTitle = `update_golang_version: {stable: "{{.StableVersion}}"}` prIssue = 9264 ) -// Data holds stable Golang version +// Data holds stable Golang version - in full and in . format type Data struct { StableVersion string `json:"stableVersion"` StableVersionMM string `json:"stableVersionMM"` // go.mod wants go version in . format @@ -107,7 +108,7 @@ func main() { // get Golang stable version stable, stableMM, err := goVersions() if err != nil || stable == "" || stableMM == "" { - klog.Fatalf("Error getting Golang stable version: %v", err) + klog.Fatalf("Unable to get Golang stable version: %v", err) } data := Data{StableVersion: stable, StableVersionMM: stableMM} klog.Infof("Golang stable version: %s", data.StableVersion) @@ -115,7 +116,7 @@ func main() { update.Apply(ctx, schema, data, prBranchPrefix, prTitle, prIssue) } -// goVersion returns Golang stable version +// goVersion returns Golang stable version. func goVersions() (stable, stableMM string, err error) { resp, err := http.Get("https://golang.org/VERSION?m=text") if err != nil {