jdxyw / lru-go

LRU cache in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lru-go

Go Go Report Card GitHub license codecov

Install

Install this package through go get.

go get github.com/jdxyw/lru-go

Simple Usage

package main

import (
	"fmt"
	"github.com/jdxyw/lru-go"
)

func main() {
	cache := lru.NewCache(100)
	cache.Add("Go", 1)
	val, _ := cache.Get("Go")

	fmt.Printf("The value for Go is %v.", val)
}

About

LRU cache in Go

License:MIT License


Languages

Language:Go 100.0%