http://blog.csdn.net/v_JULY_v/article/details/6256463
package main import ( "fmt" ) func main() { m := make(map[string]int) m["123"] = 1 m["13333"] = 2 for k,v := range m { fmt.Printf("%s %d\n", k, v) } if _,ok := m["1"]; ok { fmt.Println("found key"); } else { fmt.Println("not found"); } delete(m, "123") }
有疑问加站长微信联系(非本文作者)