We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 10219c8 commit d464c12Copy full SHA for d464c12
pkg/config/config.go
@@ -1,6 +1,7 @@
1
package config
2
3
import (
4
+ "os"
5
"strings"
6
7
hcversion "github.com/hashicorp/go-version"
@@ -54,16 +55,16 @@ func IsGreaterThanOrEqualGo118(v string) bool {
54
55
}
56
57
func DetectGoVersion() string {
- const defaultGo = "1.17"
58
-
59
- file, err := gomoddirectives.GetModuleFile()
60
- if err != nil {
61
- return defaultGo
62
- }
+ file, _ := gomoddirectives.GetModuleFile()
63
64
if file != nil && file.Go != nil {
65
return file.Go.Version
66
67
68
+ v := os.Getenv("GOVERSION")
+ if v != "" {
+ return v
+ }
+
69
+ return "1.17"
70
0 commit comments