17 lines
271 B
Go
17 lines
271 B
Go
|
package tools
|
||
|
|
||
|
import (
|
||
|
"log"
|
||
|
"testing"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
func TestNewMemory(t *testing.T) {
|
||
|
mem := NewMemory()
|
||
|
mem.Set("name", "livechat", time.Duration(10)*time.Second)
|
||
|
time.Sleep(time.Duration(2) * time.Second)
|
||
|
mem.Clean()
|
||
|
name := mem.Get("name")
|
||
|
log.Println(name)
|
||
|
}
|