Skip to content

Commit 2f26d5c

Browse files
authored
Merge pull request #728 from iamybj/patch-1
这个方式更好
2 parents 75fe66d + 9f5da65 commit 2f26d5c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

zh/04.2.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,14 @@
8686
那么我们可以这样来验证
8787

8888
slice:=[]string{"apple","pear","banane"}
89-
90-
for _, v := range slice {
91-
if v == r.Form.Get("fruit") {
89+
90+
v := r.Form.Get("fruit")
91+
for item in slice {
92+
if item == v {
9293
return true
9394
}
9495
}
96+
9597
return false
9698

9799
## 单选按钮

0 commit comments

Comments
 (0)