Description of the issue
I noticed in my Go project that autobuild successfully downloads Go modules then reports Dependencies are still not resolving after the build.
…
2023/01/24 18:14:22 Found go.mod, enabling go modules
go: downloading k8s.io/api v0.24.2
go: downloading k8s.io/apimachinery v0.24.2
go: downloading k8s.io/client-go v0.24.2
…
2023/01/24 18:14:32 Import path is 'github.com/CrunchyData/postgres-operator'
2023/01/24 18:14:32 Makefile found.
2023/01/24 18:14:32 Trying build command make []
…
2023/01/24 18:14:33 Dependencies are still not resolving after the build, continuing to install dependencies.
2023/01/24 18:14:33 Installing dependencies using `go get -v ./...`.
2023/01/24 18:14:35 Running extractor command…
…
🤔 go mod tidy downloads dependencies, so I don't expect go get needs to be called.
🤔 Is the following code correct? It seems to print error exactly when .DepsErrors is empty.
|
// DepErrors checks there are any errors resolving dependencies for `pkgpath`. It passes the `go |
|
// list` command the flags specified by `flags`. |
|
func DepErrors(pkgpath string, flags ...string) bool { |
|
out, err := runGoList("{{if .DepsErrors}}{{else}}error{{end}}", []string{pkgpath}, flags...) |
|
if err != nil { |
|
// if go list failed, assume dependencies are broken |
|
return false |
|
} |
|
|
|
return out != "" |
|
} |
Description of the issue
I noticed in my Go project that autobuild successfully downloads Go modules then reports
Dependencies are still not resolving after the build.🤔
go mod tidydownloads dependencies, so I don't expectgo getneeds to be called.🤔 Is the following code correct? It seems to print
errorexactly when.DepsErrorsis empty.codeql/go/extractor/util/util.go
Lines 170 to 180 in 07a7a21