From fd4b65d7a8661dbf1fafde81fe12fa9187f8f1bf Mon Sep 17 00:00:00 2001 From: Ronnie Lazar Date: Wed, 30 Oct 2019 16:03:16 +0200 Subject: [PATCH] Fixed review comments --- internal/queryset/generator/template.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/queryset/generator/template.go b/internal/queryset/generator/template.go index c2f98e9..374993e 100644 --- a/internal/queryset/generator/template.go +++ b/internal/queryset/generator/template.go @@ -28,18 +28,18 @@ const qsCode = ` } } - func (qs {{ .Name }}) w(db *gorm.DB) {{ .Name }} { + func (qs {{ .Name }}) w(db *gorm.DB) {{ .Name }} { return New{{ .Name }}(db) } - func (qs {{ .Name }}) Select(fields ...{{ $ft }}) {{ .Name }} { - names := []string{} - for _, f := range fields { - names = append(names, f.String()) - } + func (qs {{ .Name }}) Select(fields ...{{ $ft }}) {{ .Name }} { + names := []string{} + for _, f := range fields { + names = append(names, f.String()) + } - return qs.w(qs.db.Select(strings.Join(names, ","))) -} + return qs.w(qs.db.Select(strings.Join(names, ","))) + } {{ range .Methods }} {{ .GetDoc .GetMethodName }}