Registry / utility / pmylund-go-cache

pmylund-go-cache

JSON →
library2.1.0+incompatiblegogounverified

An in-memory key:value store/cache library for Go, suitable for concurrent access and with expiration support.

go get github.com/pmylund/go-cache
INSTALL
IMPORT
SIG · PMYLUND-GO-CACHE
P
pmylund-go-cache
utilitygov2.1.0+incompatible
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.

cache
github.com/pmylund/go-cache

Create a cache, set a key, and retrieve it.

package main import ( "fmt" "time" "github.com/pmylund/go-cache" ) func main() { c := cache.New(5*time.Minute, 10*time.Minute) c.Set("key", "value", cache.DefaultExpiration) val, found := c.Get("key") if found { fmt.Println(val) } }
Debug
Known issues
gotchaThe module path uses a +incompatible version; the latest tagged version is v2.1.0 but the module is not a Go module (no go.mod). Use the import path as shown.
fix
Use the import path github.com/pmylund/go-cache without any version suffix.
affects: >=2.0.0
Upgrade
Version history
2.1.0+incompatiblelatest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources
pmylund-go-cache — go get pmylund-go-cache · libregistry