Skip to content

Commit 4acb53f

Browse files
authored
int 和 string 使用 == 比较,可能会产生问题
```Go slice:=[]string{"1","2"} for _, v := range slice { if v == r.Form.Get("gender") { return true } } return false
1 parent 6a8c7e4 commit 4acb53f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

zh/04.2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ return false
115115
那我们也可以类似下拉菜单的做法一样
116116
```Go
117117

118-
slice:=[]int{1,2}
118+
slice:=[]string{"1","2"}
119119

120120
for _, v := range slice {
121121
if v == r.Form.Get("gender") {

0 commit comments

Comments
 (0)