fix: 修复配置字段描述换行的情况下导出的 Go 代码编译报错问题

This commit is contained in:
kercylan98 2023-07-07 17:27:18 +08:00
parent 0610928736
commit e676982b9a
1 changed files with 4 additions and 1 deletions

View File

@ -157,7 +157,10 @@ func (slf *Config) initField(sheet *xlsx.Sheet) error {
}
var field = NewField(slf.Name, fieldName, fieldType)
field.Describe = describe
field.Describe = strings.ReplaceAll(describe, "\n", ", ")
if strings.HasSuffix(field.Describe, ", ") {
field.Describe = field.Describe[:len(field.Describe)-2]
}
field.ExportParam = exportParam
switch field.ExportParam {
case "s", "sc", "cs":