зеркало из https://github.com/github/codeql-go.git
Only attempt go.mod updating if go >= 1.16
Prior to this (a) Go will attempt to update go.mod/sum anyhow, and (b) the `mod tidy -e` option isn't available.
This commit is contained in:
Родитель
570d3f47c4
Коммит
2930bd4cc2
|
@ -290,7 +290,8 @@ func main() {
|
|||
}
|
||||
}
|
||||
|
||||
if depMode == GoGetWithModules {
|
||||
// Go 1.16 and later won't automatically attempt to update go.mod / go.sum during package loading, so try to update them here:
|
||||
if depMode == GoGetWithModules && semver.Compare(getEnvGoSemVer(), "1.16") >= 0 {
|
||||
// stat go.mod and go.sum
|
||||
beforeGoModFileInfo, beforeGoModErr := os.Stat("go.mod")
|
||||
if beforeGoModErr != nil {
|
||||
|
@ -324,7 +325,6 @@ func main() {
|
|||
log.Println("We have run `go mod tidy -e` and it altered go.sum. You may wish to check these changes into version control. ")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче