13 August 2019 / golang Golang 中判断key是否在字典里存在 如题,方法如下: if val, ok := dict["foo"]; ok { //do something here }