diff --git a/go.mod b/go.mod index b8671605d17..e2ac8f90748 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/gorilla/websocket v1.5.0 - github.com/hashicorp/golang-lru v0.5.4 + github.com/hashicorp/golang-lru/v2 v2.0.1 github.com/kevinmbeaulieu/eq-go v1.0.0 github.com/logrusorgru/aurora/v3 v3.0.0 github.com/matryer/moq v0.2.7 diff --git a/go.sum b/go.sum index 9a180115562..6f835e98c4a 100644 --- a/go.sum +++ b/go.sum @@ -17,8 +17,8 @@ github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.1 h1:5pv5N1lT1fjLg2VQ5KWc7kmucp2x/kvFOnxuVTqZ6x4= +github.com/hashicorp/golang-lru/v2 v2.0.1/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/kevinmbeaulieu/eq-go v1.0.0 h1:AQgYHURDOmnVJ62jnEk0W/7yFKEn+Lv8RHN6t7mB0Zo= github.com/kevinmbeaulieu/eq-go v1.0.0/go.mod h1:G3S8ajA56gKBZm4UB9AOyoOS37JO3roToPzKNM8dtdM= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= diff --git a/graphql/handler/lru/lru.go b/graphql/handler/lru/lru.go index e2b1561acbb..68241ababf9 100644 --- a/graphql/handler/lru/lru.go +++ b/graphql/handler/lru/lru.go @@ -4,17 +4,17 @@ import ( "context" "github.com/99designs/gqlgen/graphql" - lru "github.com/hashicorp/golang-lru" + lru "github.com/hashicorp/golang-lru/v2" ) type LRU struct { - lru *lru.Cache + lru *lru.Cache[string, any] } var _ graphql.Cache = &LRU{} func New(size int) *LRU { - cache, err := lru.New(size) + cache, err := lru.New[string, any](size) if err != nil { // An error is only returned for non-positive cache size // and we already checked for that.