{"id":49925,"library":"hashicorp-golang-lru","title":"Go LRU Cache","description":"Package lru provides three different LRU caches of varying sophistication.","status":"active","version":"1.0.2","language":"go","source_language":null,"source_url":"https://github.com/hashicorp/golang-lru","tags":["lru","cache","data-structure"],"install":[{"cmd":"go get github.com/hashicorp/golang-lru","lang":"bash","label":"Install github.com/hashicorp/golang-lru"}],"dependencies":[],"imports":[{"symbol":"lru","correct":"github.com/hashicorp/golang-lru"}],"quickstart":{"code":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/hashicorp/golang-lru\"\n)\n\nfunc main() {\n\tcache, err := lru.New(100)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tcache.Add(\"key\", \"value\")\n\tif val, ok := cache.Get(\"key\"); ok {\n\t\tfmt.Println(val)\n\t}\n}","lang":"go","description":"Create an LRU cache with a maximum size of 100 entries."},"warnings":[],"env_vars":null,"search_vec":"'cach':3,10,15 'data':17 'data-structur':16 'differ':8 'go':1 'lru':2,5,9,14 'packag':4 'provid':6 'sophist':13 'structur':18 'three':7 'vari':12","created_at":"2026-06-15T04:33:17.617831+00:00","updated_at":"2026-06-15T04:33:17.617831+00:00","problems":[],"ecosystem":"go","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/hashicorp/golang-lru","github":"https://github.com/hashicorp/golang-lru","docs":"https://pkg.go.dev/github.com/hashicorp/golang-lru#section-documentation","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["utility"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-15","next_check":"2026-12-12","install_tag":null}}