From c246df60fdeefac883c99bcb68777260e7310e46 Mon Sep 17 00:00:00 2001 From: bkzy-wangjp <42510334+bkzy-wangjp@users.noreply.github.com> Date: Mon, 25 Apr 2022 18:29:39 +0800 Subject: [PATCH] Update models.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 定义多字段索引和多字段唯一键中不需要写 `[]string` --- zh-CN/mvc/model/models.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zh-CN/mvc/model/models.md b/zh-CN/mvc/model/models.md index cdfcadc3..9c82d546 100644 --- a/zh-CN/mvc/model/models.md +++ b/zh-CN/mvc/model/models.md @@ -48,14 +48,14 @@ type User struct { // 多字段索引 func (u *User) TableIndex() [][]string { return [][]string{ - []string{"Id", "Name"}, + {"Id", "Name"}, } } // 多字段唯一键 func (u *User) TableUnique() [][]string { return [][]string{ - []string{"Name", "Email"}, + {"Name", "Email"}, } } ```