From 2ef3a0d6d26079ac4ff6a246295268d2bd6a0f41 Mon Sep 17 00:00:00 2001 From: marun <35883111+run6@users.noreply.github.com> Date: Sat, 18 May 2019 12:52:23 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=82=AE=E7=AE=B1=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=9A=84=E6=AD=A3=E5=88=99=E6=9C=89=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zh/04.2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zh/04.2.md b/zh/04.2.md index 95829119..e54ce13f 100644 --- a/zh/04.2.md +++ b/zh/04.2.md @@ -64,7 +64,7 @@ if m, _ := regexp.MatchString("^[a-zA-Z]+$", r.Form.Get("engname")); !m { 你想知道用户输入的一个Email地址是否正确,通过如下这个方式可以验证: ```Go -if m, _ := regexp.MatchString(`^([\w\.\_]{2,10})@(\w{1,}).([a-z]{2,4})$`, r.Form.Get("email")); !m { +if m, _ := regexp.MatchString(`^([\w\.\_]{2,10})@(\w{1,})\.([a-z]{2,4})$`, r.Form.Get("email")); !m { fmt.Println("no") }else{ fmt.Println("yes") From 1cebe9b8b97388826558355c293f29082a35d2f3 Mon Sep 17 00:00:00 2001 From: marun <35883111+run6@users.noreply.github.com> Date: Sun, 19 May 2019 14:29:41 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E4=B8=BB=E9=94=AE?= =?UTF-8?q?=E7=9A=84=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zh/05.5.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zh/05.5.md b/zh/05.5.md index 8eefa632..f945d623 100644 --- a/zh/05.5.md +++ b/zh/05.5.md @@ -184,14 +184,14 @@ orm.SetMaxOpenConns("default", 30) ```Go type Userinfo struct { - Uid int `PK` //如果表的主键不是id,那么需要加上pk注释,显式的说这个字段是主键 + Uid int `orm:"PK"` //如果表的主键不是id,那么需要加上pk注释,显式的说这个字段是主键 Username string Departname string Created time.Time } type User struct { - Uid int `PK` //如果表的主键不是id,那么需要加上pk注释,显式的说这个字段是主键 + Uid int `orm:"PK"` //如果表的主键不是id,那么需要加上pk注释,显式的说这个字段是主键 Name string Profile *Profile `orm:"rel(one)"` // OneToOne relation Post []*Post `orm:"reverse(many)"` // 设置一对多的反向关系