Registry / utility / hashicorp-golang-lru

hashicorp-golang-lru

JSON →
library1.0.2gogounverified

Package lru provides three different LRU caches of varying sophistication.

go get github.com/hashicorp/golang-lru
INSTALL
IMPORT
SIG · HASHICORP-GOLANG-L
H
hashicorp-golang-lru
utilitygov1.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

lru
github.com/hashicorp/golang-lru

Create an LRU cache with a maximum size of 100 entries.

package main import ( "fmt" "github.com/hashicorp/golang-lru" ) func main() { cache, err := lru.New(100) if err != nil { panic(err) } cache.Add("key", "value") if val, ok := cache.Get("key"); ok { fmt.Println(val) } }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.0.2latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
hashicorp-golang-lru — go get hashicorp-golang-lru · libregistry