entc/gen: use empty slice instead of nil in sqlAll (#310)

This commit is contained in:
aca
2020-01-23 23:16:21 +09:00
committed by Ariel Mashraki
parent 3b26600834
commit 3ee6223e64
50 changed files with 119 additions and 119 deletions

View File

@@ -294,8 +294,8 @@ func (gq *GroupQuery) Select(field string, fields ...string) *GroupSelect {
func (gq *GroupQuery) sqlAll(ctx context.Context) ([]*Group, error) {
var (
nodes []*Group
_spec = gq.querySpec()
nodes []*Group = []*Group{}
_spec = gq.querySpec()
)
_spec.ScanValues = func() []interface{} {
node := &Group{config: gq.config}

View File

@@ -294,8 +294,8 @@ func (uq *UserQuery) Select(field string, fields ...string) *UserSelect {
func (uq *UserQuery) sqlAll(ctx context.Context) ([]*User, error) {
var (
nodes []*User
_spec = uq.querySpec()
nodes []*User = []*User{}
_spec = uq.querySpec()
)
_spec.ScanValues = func() []interface{} {
node := &User{config: uq.config}