mirror of
https://github.com/github/codeql.git
synced 2026-04-25 08:45:14 +02:00
Emit diagnostic to pass third inegration tests
This commit is contained in:
@@ -102,6 +102,16 @@ func EmitPackageDifferentOSArchitecture(pkgPath string) {
|
||||
)
|
||||
}
|
||||
|
||||
func EmitCannotFindPackage(pkgPath string) {
|
||||
emitDiagnostic("go/extractor/package-not-found",
|
||||
"Package "+pkgPath+" could not be found",
|
||||
"Check that the path is correct. If it is a private package, make sure it can be accessed. If it is contained in the repository then you may need a [custom build command](https://docs.github.com/en/github-ae@latest/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages#adding-build-steps-for-a-compiled-language)",
|
||||
severityError, false,
|
||||
true, true, true,
|
||||
"", 0, 0, 0, 0,
|
||||
)
|
||||
}
|
||||
|
||||
func EmitNewerGoVersionNeeded() {
|
||||
emitDiagnostic("go/autobuilder/newer-go-version-needed",
|
||||
"Newer Go version needed",
|
||||
|
||||
@@ -151,8 +151,10 @@ func ExtractWithFlags(buildFlags []string, patterns []string) error {
|
||||
if strings.Contains(errString, "build constraints exclude all Go files in ") {
|
||||
// `err` is a NoGoError from the package cmd/go/internal/load, which we cannot access as it is internal
|
||||
diagnostics.EmitPackageDifferentOSArchitecture(pkg.PkgPath)
|
||||
} else if strings.Contains(errString, "cannot find package") ||
|
||||
strings.Contains(errString, "no required module provides package") {
|
||||
diagnostics.EmitCannotFindPackage(pkg.PkgPath)
|
||||
}
|
||||
|
||||
extraction.extractError(tw, err, lbl, i)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user