Skip to content

Commit

Permalink
ua: prettier empty structs
Browse files Browse the repository at this point in the history
  • Loading branch information
magiconair committed Jul 24, 2020
1 parent 99f873a commit 4bd9178
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 38 deletions.
6 changes: 4 additions & 2 deletions cmd/service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,10 @@ type Response interface {

var tmplExtObject = template.Must(template.New("").Parse(`
type {{.Name}} struct {
{{range $i, $v := .Fields}}{{$v.Name}} {{$v.Type}}
{{end}}
{{- if .Fields}}
{{range $i, $v := .Fields}}{{$v.Name}} {{$v.Type}}
{{end}}
{{end -}}
}
{{- if .IsRequest}}
Expand Down
54 changes: 18 additions & 36 deletions ua/extobjs_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4bd9178

Please sign in to comment.