mirror of
https://github.com/github/codeql.git
synced 2026-04-23 07:45:17 +02:00
Move check for EmitNewerGoVersionNeeded diagnostic
This should only be done when --identify-environment has not been passed
This commit is contained in:
@@ -282,10 +282,6 @@ func tryReadGoDirective(depMode DependencyInstallerMode) (string, bool) {
|
||||
found = true
|
||||
if len(matches) > 1 {
|
||||
version = string(matches[1])
|
||||
semverVersion := "v" + version
|
||||
if semver.Compare(semverVersion, getEnvGoSemVer()) >= 0 {
|
||||
diagnostics.EmitNewerGoVersionNeeded()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -672,7 +668,11 @@ func installDependenciesAndBuild() {
|
||||
os.Setenv("GO111MODULE", "auto")
|
||||
}
|
||||
|
||||
_, goModVersionFound := tryReadGoDirective(depMode)
|
||||
goModVersion, goModVersionFound := tryReadGoDirective(depMode)
|
||||
|
||||
if semver.Compare("v"+goModVersion, getEnvGoSemVer()) >= 0 {
|
||||
diagnostics.EmitNewerGoVersionNeeded()
|
||||
}
|
||||
|
||||
modMode := getModMode(depMode)
|
||||
modMode = fixGoVendorIssues(modMode, depMode, goModVersionFound)
|
||||
|
||||
Reference in New Issue
Block a user