Skip to content

vendor: bump golang-lru to v2 (requires Go >= v1.18 support for generics) #579

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

Merged
merged 1 commit into from
Dec 15, 2022

Conversation

rolinh
Copy link
Member

@rolinh rolinh commented Dec 7, 2022

The new major version of github.com/hashicorp/golang-lru uses Go generics and thus Go >= v1.18 is required (this is already enforced via the go.mod file). Switching to generics means breaking changes in the API as, when declaring a new lru.Cache or invoking lru.New, the type of keys and values must be specified. However, this means that we can know trust the types of the key/value pairs we have in the cache and don't need to do any type assertion.

@rolinh rolinh requested a review from a team as a code owner December 7, 2022 15:09
@rolinh rolinh requested a review from olsajiri December 7, 2022 15:09
@rolinh rolinh marked this pull request as draft December 7, 2022 18:25
@rolinh rolinh force-pushed the pr/rolinh/golang-lru-v2 branch from 5b24ad5 to c474743 Compare December 8, 2022 08:29
@rolinh rolinh marked this pull request as ready for review December 8, 2022 08:46
…ics)

The new major version of github.com/hashicorp/golang-lru uses Go
generics and thus Go >= v1.18 is required (this is already enforced via
the go.mod file). Switching to generics means breaking changes in the
API as, when declaring a new lru.Cache or invoking lru.New, the type of
keys and values must be specified. However, this means that we can know
trust the types of the key/value pairs we have in the cache and don't
need to do any type assertion.

Signed-off-by: Robin Hahling <[email protected]>
@rolinh rolinh force-pushed the pr/rolinh/golang-lru-v2 branch from c474743 to 9578b40 Compare December 8, 2022 08:49
@kkourt kkourt self-requested a review December 9, 2022 08:16
Copy link
Contributor

@kkourt kkourt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Many thanks @rolinh!

@kkourt kkourt merged commit 3a9936b into main Dec 15, 2022
@kkourt kkourt deleted the pr/rolinh/golang-lru-v2 branch December 15, 2022 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants