-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
x/vuln: package slices is not in GOROOT #68034
Comments
Similar Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
The Go Release Policy states that each major Go release is supported until there are two newer major releases. Since go 1.22 was released back in February it has been a couple months that Go 1.20 does not receive any kind of security update. Plus you are installing the most recent commit of vuln ( My advice is that you should update to a supported release. Edit: sorry for the ping |
The go.mod argument is valid, we should probably change it to go 1.21. |
cc @golang/vulndb |
Looking a bit more into it, the only place that imports slices was added 2 weeks ago in https://go-review.googlesource.com/c/vuln/+/575859. I wonder if we should have used x/exp/slices instead. |
We have been discussing as a team what our strategy should be for keeping the go.mod go lines up to date across all the x repositories, we should probably just manually update this one for now as that conversation progresses. |
Change https://go.dev/cl/593235 mentions this issue: |
Understood. I'm stuck on an older version until RHEL 9 tooling updates so that's why it's using v1.20 |
go vuln doesn't support 1.20 anymore. It isn't required for tests to pass, so bump it to 1.21 even though we are still targeting 1.20, hopefully any errors it finds will be helpful in the future. See: * golang/go#68034 * golang/vuln@f35edf8
go vuln doesn't support 1.20 anymore. It isn't required for tests to pass, so bump it to 1.21 even though we are still targeting 1.20, hopefully any errors it finds will be helpful in the future. See: * golang/go#68034 * golang/vuln@f35edf8
go vuln doesn't support 1.20 anymore. It isn't required for tests to pass, so bump it to 1.21 even though we are still targeting 1.20, hopefully any errors it finds will be helpful in the future. See: * golang/go#68034 * golang/vuln@f35edf8
Change https://go.dev/cl/595935 mentions this issue: |
Use the go directive in go.mod as the single source of truth for the required Go version for installing golvulncheck. Updates golang/go#68034 Fixes golang/go#68256 Change-Id: Ief445ffa40282feff6a97419b48dc6290071d971 Reviewed-on: https://go-review.googlesource.com/c/vuln/+/595935 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
Had the same issue. The two options are: install [PATCH] Remove slices packagediff --git a/go.mod b/go.mod
index 1412cb1..dd7e820 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
module golang.org/x/vuln
-go 1.21
+go 1.18
require (
github.com/google/go-cmdtest v0.4.1-0.20220921163831-55ab3332a786
diff --git a/internal/openvex/handler.go b/internal/openvex/handler.go
index b5e43aa..8553743 100644
--- a/internal/openvex/handler.go
+++ b/internal/openvex/handler.go
@@ -9,7 +9,7 @@ import (
"encoding/json"
"fmt"
"io"
- "slices"
+ "sort"
"time"
"golang.org/x/vuln/internal/govulncheck"
@@ -153,16 +153,8 @@ func statements(h *handler) []Statement {
statements = append(statements, s)
}
- slices.SortFunc(statements, func(a, b Statement) int {
- if a.Vulnerability.ID > b.Vulnerability.ID {
- return 1
- }
- if a.Vulnerability.ID < b.Vulnerability.ID {
- return -1
- }
- // this should never happen in practice, since statements are being
- // populated from a map with the vulnerability IDs as keys
- return 0
+ sort.Slice(statements, func(i, j int) bool {
+ return statements[i].Vulnerability.ID < statements[j].Vulnerability.ID
})
return statements
} |
FWIW, newly released govulncheck v1.1.3 now requires go1.21 and newer. |
Same here. We are stuck to 1.19 for windows use. v1.1.1 works. keep in mind that https://go.dev/doc/tutorial/govulncheck indicates that works from 1.18. Should be changed? |
Change https://go.dev/cl/614235 mentions this issue: |
govulncheck's go.mod now requires the use of Go version that is at least one less than the current latest Go release. Remove the old restriction as that is now incorrect and confusing. Just tell people to use the latest Go version. Updates golang/go#68034 Change-Id: I97a59d4764592496918b44c10345a2fadb92aac8 Reviewed-on: https://go-review.googlesource.com/c/website/+/614235 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Cottrell <iancottrell@google.com>
Should be addressed now. |
When using vuln with go v1.20.14 it fails to install because slices is not in the standard library. The vuln docs, and go.mod, claim to be compatible with go 1.18 and later.
https://github.com/osbuild/weldr-client/actions/runs/9542027269/job/26296139660?pr=139
The text was updated successfully, but these errors were encountered: