mirror of
https://github.com/ent/ent.git
synced 2026-05-28 09:49:08 +03:00
entc/gen: use empty slice instead of nil in sqlAll (#310)
This commit is contained in:
@@ -294,9 +294,9 @@ func (cq *CarQuery) Select(field string, fields ...string) *CarSelect {
|
||||
|
||||
func (cq *CarQuery) sqlAll(ctx context.Context) ([]*Car, error) {
|
||||
var (
|
||||
nodes []*Car
|
||||
withFKs = cq.withFKs
|
||||
_spec = cq.querySpec()
|
||||
nodes []*Car = []*Car{}
|
||||
withFKs = cq.withFKs
|
||||
_spec = cq.querySpec()
|
||||
)
|
||||
if cq.withOwner != nil {
|
||||
withFKs = true
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -319,8 +319,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