Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在 Go 中获取地图中的条目数量。有没有比以下更好的方法:
count := 0 for key := range mymap { count++ }
谢谢!
len 函数适用于此:
http://golang.org/ref/spec#Length_and_capacity