問題
問題
func main() {
var a map[string]int
a["a"] = 1 //panic: assignment to entry in nil map
b := a["b"]
print(b)
if b != nil {// compile- invalid operation: v != nil (mismatched types int and untyped nil)
print(v)
}
}Last updated
問題
func main() {
var a map[string]int
a["a"] = 1 //panic: assignment to entry in nil map
b := a["b"]
print(b)
if b != nil {// compile- invalid operation: v != nil (mismatched types int and untyped nil)
print(v)
}
}Last updated