gitee.com/quant1x/gox@v1.21.2/cache/map_test.go (about)

     1  package cache
     2  
     3  import (
     4  	"fmt"
     5  	"testing"
     6  )
     7  
     8  func TestMap(t *testing.T) {
     9  	key := "1"
    10  	var t1 TestStruct
    11  	t1.Name = "test"
    12  	var m Map[string, TestStruct]
    13  	m.Put(key, t1)
    14  	t2, ok := m.Get(key)
    15  	fmt.Println(t2, ok)
    16  	key = "2"
    17  	t3, ok := m.Get(key)
    18  	fmt.Println(t3, ok)
    19  }