-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flags stdilb as "does not have module info" when on go 1.21.X
#244
Comments
go 1.21.X
go 1.21.X
This should be fixed in go 1.21.4 |
This happened to me on go 1.12.5...
and many others. Am I doing something wrong? |
The problem is that in The result is that your standard libs (that don't have any modules) will then trigger this error because they are not detected as standard libs anymore. // isStdLib returns true if this package is part of the Go standard library.
func isStdLib(pkg *packages.Package) bool {
if pkg.Name == "unsafe" {
// Special case unsafe stdlib, because it does not contain go files.
return true
}
if len(pkg.GoFiles) == 0 {
return false
}
prefix := build.Default.GOROOT
sep := string(filepath.Separator)
if !strings.HasSuffix(prefix, sep) {
prefix += sep
}
return strings.HasPrefix(pkg.GoFiles[0], prefix)
} |
The solution would be to fix |
Some additional context:
|
You could add a In the end, it's a lottery ;-) If your local go installation is the same or newer than any specified toolchain (either in go.mod or via env var), then you are lucky because your bundled toolchain is used. If not, the toolchain will be downloaded by your go installation and stored below All the gory details about toolchains are in the go toolchain docs |
This is a workaround for google/go-licenses#244.
* Ignore stdlib This is a workaround for google/go-licenses#244. * Add an explanatory comment
I am seeing a license warning for all stdlib packages used:
(source: https://github.com/pulumi/pulumi-vault/actions/runs/6817936124/job/18542508655?pr=330)
This is not the case when I change the version back from
go 1.21.3
togo 1.21
.It looks like there is some problem with https://github.com/google/go-licenses/tree/master/internal/third_party/pkgsite, but I'm not familiar enough with this repo to be sure.
The text was updated successfully, but these errors were encountered: