Skip to content

Commit ae3fc86

Browse files
chore: update golang-lru to v2.0.4, fixing semver violation (#2448)
1 parent dcc221e commit ae3fc86

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ require (
1212
github.com/golang/mock v1.6.0
1313
github.com/google/gopacket v1.1.19
1414
github.com/gorilla/websocket v1.5.0
15-
github.com/hashicorp/golang-lru/v2 v2.0.2
15+
github.com/hashicorp/golang-lru/arc/v2 v2.0.4
16+
github.com/hashicorp/golang-lru/v2 v2.0.4
1617
github.com/ipfs/go-cid v0.4.1
1718
github.com/ipfs/go-datastore v0.6.0
1819
github.com/ipfs/go-ds-badger v0.3.0

go.sum

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,10 @@ github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:Fecb
227227
github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
228228
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
229229
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
230-
github.com/hashicorp/golang-lru/v2 v2.0.2 h1:Dwmkdr5Nc/oBiXgJS3CDHNhJtIHkuZ3DZF5twqnfBdU=
231-
github.com/hashicorp/golang-lru/v2 v2.0.2/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
230+
github.com/hashicorp/golang-lru/arc/v2 v2.0.4 h1:+tHnVSaabYlClRqUq4/+xzeyy9nAf8ju/JJsb4KTNBc=
231+
github.com/hashicorp/golang-lru/arc/v2 v2.0.4/go.mod h1:rbQ1sKlUmbE1QbWxZbqtbpw8frA8ecNEhI0cQBxYtaU=
232+
github.com/hashicorp/golang-lru/v2 v2.0.4 h1:7GHuZcgid37q8o5i3QI9KMT4nCWQQ3Kx3Ov6bb9MfK0=
233+
github.com/hashicorp/golang-lru/v2 v2.0.4/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
232234
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
233235
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
234236
github.com/huin/goupnp v1.2.0 h1:uOKW26NG1hsSSbXIZ1IR7XP9Gjd1U8pnLaCMgntmkmY=

p2p/host/peerstore/pstoreds/addr_book.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoreds/pb"
1515
"github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoremem"
1616

17-
lru "github.com/hashicorp/golang-lru/v2"
17+
"github.com/hashicorp/golang-lru/arc/v2"
1818
ds "github.com/ipfs/go-datastore"
1919
"github.com/ipfs/go-datastore/query"
2020
logging "github.com/ipfs/go-log/v2"
@@ -202,7 +202,7 @@ func NewAddrBook(ctx context.Context, store ds.Batching, opts Options) (ab *dsAd
202202
}
203203

204204
if opts.CacheSize > 0 {
205-
if ab.cache, err = lru.NewARC[peer.ID, *addrsRecord](int(opts.CacheSize)); err != nil {
205+
if ab.cache, err = arc.NewARC[peer.ID, *addrsRecord](int(opts.CacheSize)); err != nil {
206206
return nil, err
207207
}
208208
} else {

0 commit comments

Comments
 (0)