//空字符串var someEmptyString = ""var anotherEmptyString = ""if someEmptyString == "" { //字符串为空} if len(anotherEmptyString) == 0 { //字符串为空}