main FUNC () { // Go of k, v value pairs // key sub-map, the statement var A = Map [ int ] String { . 1 : " WO " , 2 : " WAAS " } // because more storage type multi uncertainty value returned is 0, or nil, or other null value, then it is ok that can represent values T or F, such a simple determination IF V, ok: a = [ 10 ]; ok { fmt.Println ( " has a value " , V) } the else { fmt.Println ( " the value is null " ) } // cycle value //Here is a direct access to the value of k and v, and the map is disordered for k, V: = Range {a fmt.Println (k) fmt.Println (V) } }
go in the map, such as a dictionary in python
Guess you like
Origin www.cnblogs.com/yangxinpython/p/12025099.html
Recommended
Ranking