Update common.go
当表字段类型为datetime或者date并且默认为NULL时,在结构中需要设置成指针类型
This commit is contained in:
@@ -100,6 +100,9 @@ func fixNullToPorint(name string, isNull bool) string {
|
||||
if strings.HasPrefix(name, "float") {
|
||||
return "*" + name
|
||||
}
|
||||
if strings.HasPrefix(name, "date") {
|
||||
return "*" + name
|
||||
}
|
||||
if strings.HasPrefix(name, "time") {
|
||||
return "*" + name
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user