我有一个格式的地图:
map[string]map[string]int
在这个主图中,我想做一些类似于putIfAbsent("key", new HashMap<>()Java 中的事情。在 Go 中,什么是干净且快捷的方法?
putIfAbsent("key", new HashMap<>()
go
在 Go 中将 "" 存储为映射键是好还是坏的做法?这似乎是一种特殊情况,不适合作为钥匙存储。你怎么认为?
string dictionary go
go ×2
dictionary ×1
string ×1