1
0
mirror of https://github.com/beego/bee.git synced 2024-12-22 10:00:50 +00:00

if tag.Comment is empty, the ORM tag string will not contain description

This commit is contained in:
hudangwei 2017-05-30 19:43:40 +08:00
parent f5471680e4
commit 812b8c4e5b

View File

@ -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) {