From ce1c02f4f9059fcc0dce16cf30bdb30744985732 Mon Sep 17 00:00:00 2001 From: chowyu12 <81024796+chowyu12@users.noreply.github.com> Date: Wed, 28 Dec 2022 14:53:22 +0800 Subject: [PATCH] Feat: ignorecolums add sort (#2648) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add go-grpc_opt and go_opt for grpc new command * feat: remove log when disable log * feat: add sort Co-authored-by: zhouyy --- tools/goctl/model/sql/gen/vars.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/goctl/model/sql/gen/vars.go b/tools/goctl/model/sql/gen/vars.go index 9df8c32a..f5408bcd 100644 --- a/tools/goctl/model/sql/gen/vars.go +++ b/tools/goctl/model/sql/gen/vars.go @@ -2,6 +2,7 @@ package gen import ( "fmt" + "sort" "strings" "github.com/zeromicro/go-zero/core/collection" @@ -43,7 +44,9 @@ func genVars(table Table, withCache, postgreSql bool) (string, error) { set.AddStr(fmt.Sprintf("\"`%s`\"", c)) } } - return strings.Join(set.KeysStr(), ", ") + list := set.KeysStr() + sort.Strings(list) + return strings.Join(list, ", ") }(), }) if err != nil {