Thread safe GoLang fixed size FIFO with O(1) Get
.
import (
"fmt"
"github.com/floatdrop/fifo"
)
func main() {
cache := fifo.New[string, int](256)
cache.Push("Hello", 5)
if e := cache.Get("Hello"); e != nil {
fmt.Println(*e)
// Output: 5
}
}