Skip to content

Commit

Permalink
gopls: update golang.org/x/vuln@6ad3e3d
Browse files Browse the repository at this point in the history
govulncheck.DefaultCache interface was changed to return error.
Update callsites.

Notable changes:
  vulncheck performance improvements (golang/go#57357)
   https://go-review.googlesource.com/c/vuln/+/460422
   https://go-review.googlesource.com/c/vuln/+/460420
  store the vuln info cache under module cache directory
   https://go-review.googlesource.com/c/vuln/+/459036
   https://go-review.googlesource.com/c/vuln/+/460421

Change-Id: Ie3816f31b4e1178bb2067cb09c1c726dd37fad55
Reviewed-on: https://go-review.googlesource.com/c/tools/+/461417
Run-TryBot: Hyang-Ah Hana Kim <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
gopls-CI: kokoro <[email protected]>
Reviewed-by: Robert Findley <[email protected]>
  • Loading branch information
hyangah committed Jan 12, 2023
1 parent d19e3d1 commit e81af27
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions gopls/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ require (
golang.org/x/sync v0.1.0
golang.org/x/sys v0.4.0
golang.org/x/text v0.6.0
golang.org/x/tools v0.4.0
golang.org/x/vuln v0.0.0-20221212182831-af59454a8a0a
golang.org/x/tools v0.4.1-0.20221217013628-b4dfc36097e2
golang.org/x/vuln v0.0.0-20230110180137-6ad3e3d07815
gopkg.in/yaml.v3 v3.0.1
honnef.co/go/tools v0.3.3
mvdan.cc/gofumpt v0.4.0
Expand Down
2 changes: 2 additions & 0 deletions gopls/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k=
golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/vuln v0.0.0-20221212182831-af59454a8a0a h1:KWIh6uTTw7r3PEz1N1OIEM8pr5bf1uP1n6JL5Ml56X8=
golang.org/x/vuln v0.0.0-20221212182831-af59454a8a0a/go.mod h1:54iI0rrZVM8VdIvTrT/sdlVfMUJWOgvTRQN24CEtZk0=
golang.org/x/vuln v0.0.0-20230110180137-6ad3e3d07815 h1:A9kONVi4+AnuOr1dopsibH6hLi1Huy54cbeJxnq4vmU=
golang.org/x/vuln v0.0.0-20230110180137-6ad3e3d07815/go.mod h1:XJiVExZgoZfrrxoTeVsFYrSSk1snhfpOEC95JL+A4T0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
12 changes: 10 additions & 2 deletions gopls/internal/vulncheck/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,12 @@ func init() {
return err
}
logf("Loaded %d packages and their dependencies", len(pkgs))
cache, err := govulncheck.DefaultCache()
if err != nil {
return err
}
cli, err := client.NewClient(findGOVULNDB(cfg.Env), client.Options{
HTTPCache: govulncheck.DefaultCache(),
HTTPCache: cache,
})
if err != nil {
return err
Expand Down Expand Up @@ -232,9 +236,13 @@ func vulnerablePackages(ctx context.Context, snapshot source.Snapshot, modfile s
}

// Request vuln entries from remote service.
fsCache, err := govulncheck.DefaultCache()
if err != nil {
return nil, err
}
cli, err := client.NewClient(
findGOVULNDB(snapshot.View().Options().EnvSlice()),
client.Options{HTTPCache: govulncheck.NewInMemoryCache(govulncheck.DefaultCache())})
client.Options{HTTPCache: govulncheck.NewInMemoryCache(fsCache)})
if err != nil {
return nil, err
}
Expand Down

0 comments on commit e81af27

Please sign in to comment.