From 7e96eaa2737427a8fb15acc9b774a776370368c6 Mon Sep 17 00:00:00 2001 From: Chris Smowton Date: Tue, 23 Jan 2024 10:49:52 +0000 Subject: [PATCH] Log advice when a newer Go version is required under Actions --- go/extractor/cli/go-autobuilder/go-autobuilder.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/go/extractor/cli/go-autobuilder/go-autobuilder.go b/go/extractor/cli/go-autobuilder/go-autobuilder.go index 7d1d04685376..88a1171bc66c 100644 --- a/go/extractor/cli/go-autobuilder/go-autobuilder.go +++ b/go/extractor/cli/go-autobuilder/go-autobuilder.go @@ -800,6 +800,9 @@ func installDependenciesAndBuild() { // Go tooling should install required Go versions as needed. if semver.Compare(getEnvGoSemVer(), "v1.21.0") < 0 && goVersionInfo.Found && semver.Compare("v"+goVersionInfo.Version, getEnvGoSemVer()) > 0 { diagnostics.EmitNewerGoVersionNeeded() + if val, _ := os.LookupEnv("GITHUB_ACTIONS"); val == "true" { + log.Printf("The go.mod version is newer than the installed version of Go. Consider adding an actions/setup-go step to your workflow.\n") + } } fixGoVendorIssues(&buildInfo, goVersionInfo.Found)