github.com/chain5j/chain5j-pkg@v1.0.7/collection/lookup/lookup_test.go (about) 1 // Package lookup 2 // 3 // @author: xwc1125 4 package lookup 5 6 import ( 7 "fmt" 8 "testing" 9 ) 10 11 var ( 12 allKeyList map[string]struct{} 13 ) 14 15 func Test1(t *testing.T) { 16 allKeyList = make(map[string]struct{}) 17 hash := "0x57f09E3a3E66F4C70B19Be63dCa6e1bF72eA4Eb1" 18 allKeyList[hash] = struct{}{} 19 fmt.Println("pre", allKeyList) 20 delete(allKeyList, hash) 21 fmt.Println("post", allKeyList) 22 if k, ok := allKeyList[hash]; ok { 23 fmt.Println("Post", k, "ok=", ok) 24 } 25 }