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,9 +294,9 @@ func (pq *PetQuery) Select(field string, fields ...string) *PetSelect {
func (pq *PetQuery) sqlAll(ctx context.Context) ([]*Pet, error) {
var (
nodes []*Pet
withFKs = pq.withFKs
_spec = pq.querySpec()
nodes []*Pet = []*Pet{}
withFKs = pq.withFKs
_spec = pq.querySpec()
)
if pq.withOwner != nil {
withFKs = true

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}