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 }}