victorspringer / http-cache

High performance Golang HTTP middleware for server-side application layer caching, ideal for REST APIs
https://godoc.org/github.com/victorspringer/http-cache
MIT License
339 stars 63 forks source link

fix race condition in memoryadapter set #15

Closed kdeberk closed 1 year ago

kdeberk commented 1 year ago

There were some race conditions in this function:

Added a test to spot both issues.

Also updated the benchmarks to use strconv.Atoi instead of string for converting from int to string, modern go doesn't support that conversion.

victorspringer commented 1 year ago

LGTM. Thanks @kdeberk