如何判断 map 中是否包含某个 key ?


var sample map[int]int
if _, ok := sample[10]; ok {

} else {

}



0 0
讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!
帮助