Skip to content

Commit

Permalink
fix: 修复配置字段描述换行的情况下导出的 Go 代码编译报错问题
Browse files Browse the repository at this point in the history
  • Loading branch information
kercylan98 committed Jul 7, 2023
1 parent 0610928 commit e676982
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion planner/configexport/internal/config.go
Original file line number Diff line number Diff line change
@@ -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":

0 comments on commit e676982

Please sign in to comment.