Skip to content

Commit

Permalink
Merge pull request #1390 from hizzuu/fix-comment-position-in-first-co…
Browse files Browse the repository at this point in the history
…lumn-of-table

fix comment position in first column of table
  • Loading branch information
stephenafamo authored Jun 17, 2024
2 parents 6251f87 + 87a0d4d commit 4b7da0d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions templates/main/00_struct.go.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@

// {{$alias.UpSingular}} is an object representing the database table.
type {{$alias.UpSingular}} struct {
{{- range $column := .Table.Columns -}}
{{- range $index, $column := .Table.Columns -}}
{{- $colAlias := $alias.Column $column.Name -}}
{{- $orig_col_name := $column.Name -}}
{{- range $column.Comment | splitLines -}} // {{ . }}
{{- range $column.Comment | splitLines -}}
{{- if eq $index 0 -}}
{{ "\n" }}
{{- end -}}
// {{ . }}
{{ end -}}

{{if ignore $orig_tbl_name $orig_col_name $.TagIgnore -}}
Expand Down

0 comments on commit 4b7da0d

Please sign in to comment.