mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: use empty slice instead of nil in sqlAll (#310)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user