Skip to content

Instantly share code, notes, and snippets.

@juntaki
Created March 22, 2019 02:57
Show Gist options
  • Save juntaki/d4033a49d8bb1095d8771612b338fdf3 to your computer and use it in GitHub Desktop.
Save juntaki/d4033a49d8bb1095d8771612b338fdf3 to your computer and use it in GitHub Desktop.
package {{.Models}}
{{$ilen := len .Imports}}
{{if gt $ilen 0}}
import (
{{range .Imports}}"{{.}}"{{end}}
)
{{end}}
{{range .Tables}}
type {{Mapper .Name}} struct {
{{$table := .}}
{{range .ColumnsSeq}}{{$col := $table.GetColumn .}} {{Mapper $col.Name}} {{Type $col}} {{Tag $table $col}} /* {{$col.Comment}} */
{{end}}}
{{end}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment