Feat: ignorecolums add sort (#2648)

* add go-grpc_opt and go_opt for grpc new command

* feat: remove log when disable log

* feat: add sort

Co-authored-by: zhouyy <zhouyy@ickey.cn>
master
chowyu12 2 years ago committed by GitHub
parent c3756a8f1c
commit ce1c02f4f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,6 +2,7 @@ package gen
import ( import (
"fmt" "fmt"
"sort"
"strings" "strings"
"github.com/zeromicro/go-zero/core/collection" "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)) set.AddStr(fmt.Sprintf("\"`%s`\"", c))
} }
} }
return strings.Join(set.KeysStr(), ", ") list := set.KeysStr()
sort.Strings(list)
return strings.Join(list, ", ")
}(), }(),
}) })
if err != nil { if err != nil {

Loading…
Cancel
Save