Merge pull request #728 from iamybj/patch-1

这个方式更好
This commit is contained in:
astaxie
2016-10-19 12:05:49 +08:00
committed by GitHub

View File

@@ -86,12 +86,14 @@
那么我们可以这样来验证
slice:=[]string{"apple","pear","banane"}
for _, v := range slice {
if v == r.Form.Get("fruit") {
v := r.Form.Get("fruit")
for item in slice {
if item == v {
return true
}
}
return false
## 单选按钮