fix(goctl): fix redundant import (#2551)
This commit is contained in:
@@ -153,17 +153,18 @@ func ConvertDataType(dataBaseType int, isDefaultNull, unsigned, strict bool) (st
|
||||
}
|
||||
|
||||
// ConvertStringDataType converts mysql column type into golang type
|
||||
func ConvertStringDataType(dataBaseType string, isDefaultNull, unsigned, strict bool) (string, error) {
|
||||
func ConvertStringDataType(dataBaseType string, isDefaultNull, unsigned, strict bool) (
|
||||
goType string, isPQArray bool, err error) {
|
||||
tp, ok := commonMysqlDataTypeMapString[strings.ToLower(dataBaseType)]
|
||||
if !ok {
|
||||
return "", fmt.Errorf("unsupported database type: %s", dataBaseType)
|
||||
return "", false, fmt.Errorf("unsupported database type: %s", dataBaseType)
|
||||
}
|
||||
|
||||
if strings.HasPrefix(dataBaseType, "_") {
|
||||
return tp, nil
|
||||
return tp, true, nil
|
||||
}
|
||||
|
||||
return mayConvertNullType(tp, isDefaultNull, unsigned, strict), nil
|
||||
return mayConvertNullType(tp, isDefaultNull, unsigned, strict), false, nil
|
||||
}
|
||||
|
||||
func mayConvertNullType(goDataType string, isDefaultNull, unsigned, strict bool) string {
|
||||
|
||||
Reference in New Issue
Block a user