Use the proper logic when disabling the go module version

Signed-off-by: Cosmin Cojocar <cosmin@cojocar.ch>
This commit is contained in:
Cosmin Cojocar 2024-05-22 10:27:16 +02:00
parent 1e1fc91d15
commit 75dd9d61ff

View file

@ -502,7 +502,7 @@ func RootPath(root string) (string, error) {
// GoVersion returns parsed version of Go mod version and fallback to runtime version if not found.
func GoVersion() (int, int, int) {
_, ok := os.LookupEnv(noGoModVersion)
if ok {
if !ok {
if goModVersion, err := goModVersion(); err == nil {
return parseGoVersion(goModVersion)
}