Skip to content

Commit 4b7da0d

Browse files
authored
Merge pull request #1390 from hizzuu/fix-comment-position-in-first-column-of-table
fix comment position in first column of table
2 parents 6251f87 + 87a0d4d commit 4b7da0d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

templates/main/00_struct.go.tpl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33

44
// {{$alias.UpSingular}} is an object representing the database table.
55
type {{$alias.UpSingular}} struct {
6-
{{- range $column := .Table.Columns -}}
6+
{{- range $index, $column := .Table.Columns -}}
77
{{- $colAlias := $alias.Column $column.Name -}}
88
{{- $orig_col_name := $column.Name -}}
9-
{{- range $column.Comment | splitLines -}} // {{ . }}
9+
{{- range $column.Comment | splitLines -}}
10+
{{- if eq $index 0 -}}
11+
{{ "\n" }}
12+
{{- end -}}
13+
// {{ . }}
1014
{{ end -}}
1115

1216
{{if ignore $orig_tbl_name $orig_col_name $.TagIgnore -}}

0 commit comments

Comments
 (0)