mirror of https://github.com/zhufuyi/sponge
fix mongodb parse bug
This commit is contained in:
parent
b63c1addc4
commit
7761fcd7b7
3
go.sum
3
go.sum
|
@ -367,8 +367,9 @@ github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpT
|
|||
github.com/hashicorp/serf v0.9.7 h1:hkdgbqizGQHuU5IPqYM1JdSMV8nKfpuOnZYXssk9muY=
|
||||
github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4=
|
||||
github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
|
||||
github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU=
|
||||
github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
|
||||
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||
github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w=
|
||||
|
|
|
@ -204,10 +204,10 @@ func toLowerFirst(str string) string {
|
|||
func embedTimeField(names []string, fields []*MgoField) []*MgoField {
|
||||
isHaveCreatedAt, isHaveUpdatedAt := false, false
|
||||
for _, name := range names {
|
||||
if name == "created_at" {
|
||||
if name == "created_at" || name == "createdAt" {
|
||||
isHaveCreatedAt = true
|
||||
}
|
||||
if name == "updated_at" {
|
||||
if name == "updated_at" || name == "updatedAt" {
|
||||
isHaveUpdatedAt = true
|
||||
}
|
||||
names = append(names, name)
|
||||
|
|
|
@ -972,7 +972,7 @@ func goTypeToProto(fields []tmplField) []tmplField {
|
|||
field.GoType = "repeated string"
|
||||
}
|
||||
|
||||
if field.DBDriver == DBDriverMongodb {
|
||||
if field.DBDriver == DBDriverMongodb && field.GoType != "" {
|
||||
if field.GoType[0] == '*' {
|
||||
field.GoType = field.GoType[1:]
|
||||
} else if strings.Contains(field.GoType, "[]*") {
|
||||
|
|
Loading…
Reference in New Issue