Skip to content

Commit f939c7e

Browse files
authored
Merge pull request #1089 from run6/master
邮箱验证的正则有误
2 parents a915fcb + 1cebe9b commit f939c7e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

zh/04.2.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ if m, _ := regexp.MatchString("^[a-zA-Z]+$", r.Form.Get("engname")); !m {
6464
你想知道用户输入的一个Email地址是否正确,通过如下这个方式可以验证:
6565
```Go
6666

67-
if m, _ := regexp.MatchString(`^([\w\.\_]{2,10})@(\w{1,}).([a-z]{2,4})$`, r.Form.Get("email")); !m {
67+
if m, _ := regexp.MatchString(`^([\w\.\_]{2,10})@(\w{1,})\.([a-z]{2,4})$`, r.Form.Get("email")); !m {
6868
fmt.Println("no")
6969
}else{
7070
fmt.Println("yes")

zh/05.5.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,14 @@ orm.SetMaxOpenConns("default", 30)
184184
```Go
185185

186186
type Userinfo struct {
187-
Uid int `PK` //如果表的主键不是id,那么需要加上pk注释,显式的说这个字段是主键
187+
Uid int `orm:"PK"` //如果表的主键不是id,那么需要加上pk注释,显式的说这个字段是主键
188188
Username string
189189
Departname string
190190
Created time.Time
191191
}
192192

193193
type User struct {
194-
Uid int `PK` //如果表的主键不是id,那么需要加上pk注释,显式的说这个字段是主键
194+
Uid int `orm:"PK"` //如果表的主键不是id,那么需要加上pk注释,显式的说这个字段是主键
195195
Name string
196196
Profile *Profile `orm:"rel(one)"` // OneToOne relation
197197
Post []*Post `orm:"reverse(many)"` // 设置一对多的反向关系

0 commit comments

Comments
 (0)