-1
以下代碼產生true
。所以我想知道在Golang的map[string]string
,有沒有辦法區分空字符串和什麼都沒有?如何區分空字符串和地圖中的任何內容
package main
import "fmt"
func main() {
m := make(map[string]string)
m["abc"] = ""
fmt.Println(m["a"] == m["abc"]) //true
}
謝謝@TimCooper。對不起,我沒有看到這個問題。 –