diff --git a/generate/g_appcode.go b/generate/g_appcode.go index a514263..42c5445 100644 --- a/generate/g_appcode.go +++ b/generate/g_appcode.go @@ -256,7 +256,10 @@ func (tag *OrmTag) String() string { if len(ormOptions) == 0 { return "" } - return fmt.Sprintf("`orm:\"%s\" description:\"%s\"`", strings.Join(ormOptions, ";"), tag.Comment) + if tag.Comment != "" { + return fmt.Sprintf("`orm:\"%s\" description:\"%s\"`", strings.Join(ormOptions, ";"), tag.Comment) + } + return fmt.Sprintf("`orm:\"%s\"`", strings.Join(ormOptions, ";")) } func GenerateAppcode(driver, connStr, level, tables, currpath string) {