mirror of
https://github.com/zhufuyi/sponge.git
synced 2025-10-06 09:17:19 +08:00
fix mongodb parse bug
This commit is contained in:
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 h1:hkdgbqizGQHuU5IPqYM1JdSMV8nKfpuOnZYXssk9muY=
|
||||||
github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4=
|
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/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.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-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-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||||
github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w=
|
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 {
|
func embedTimeField(names []string, fields []*MgoField) []*MgoField {
|
||||||
isHaveCreatedAt, isHaveUpdatedAt := false, false
|
isHaveCreatedAt, isHaveUpdatedAt := false, false
|
||||||
for _, name := range names {
|
for _, name := range names {
|
||||||
if name == "created_at" {
|
if name == "created_at" || name == "createdAt" {
|
||||||
isHaveCreatedAt = true
|
isHaveCreatedAt = true
|
||||||
}
|
}
|
||||||
if name == "updated_at" {
|
if name == "updated_at" || name == "updatedAt" {
|
||||||
isHaveUpdatedAt = true
|
isHaveUpdatedAt = true
|
||||||
}
|
}
|
||||||
names = append(names, name)
|
names = append(names, name)
|
||||||
|
@@ -972,7 +972,7 @@ func goTypeToProto(fields []tmplField) []tmplField {
|
|||||||
field.GoType = "repeated string"
|
field.GoType = "repeated string"
|
||||||
}
|
}
|
||||||
|
|
||||||
if field.DBDriver == DBDriverMongodb {
|
if field.DBDriver == DBDriverMongodb && field.GoType != "" {
|
||||||
if field.GoType[0] == '*' {
|
if field.GoType[0] == '*' {
|
||||||
field.GoType = field.GoType[1:]
|
field.GoType = field.GoType[1:]
|
||||||
} else if strings.Contains(field.GoType, "[]*") {
|
} else if strings.Contains(field.GoType, "[]*") {
|
||||||
|
Reference in New Issue
Block a user