mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: change <E>WithError signature to <E>Err (#322)
<E>WithError is too verbose and we like short names
This commit is contained in:
@@ -33,9 +33,9 @@ type GroupEdges struct {
|
||||
loadedTypes [1]bool
|
||||
}
|
||||
|
||||
// UsersWithError returns the Users value or an error if the edge
|
||||
// UsersErr returns the Users value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e GroupEdges) UsersWithError() ([]*User, error) {
|
||||
func (e GroupEdges) UsersErr() ([]*User, error) {
|
||||
if e.loadedTypes[0] {
|
||||
return e.Users, nil
|
||||
}
|
||||
|
||||
@@ -38,18 +38,18 @@ type UserEdges struct {
|
||||
loadedTypes [3]bool
|
||||
}
|
||||
|
||||
// GroupsWithError returns the Groups value or an error if the edge
|
||||
// GroupsErr returns the Groups value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e UserEdges) GroupsWithError() ([]*Group, error) {
|
||||
func (e UserEdges) GroupsErr() ([]*Group, error) {
|
||||
if e.loadedTypes[0] {
|
||||
return e.Groups, nil
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "groups"}
|
||||
}
|
||||
|
||||
// ParentWithError returns the Parent value or an error if the edge
|
||||
// ParentErr returns the Parent value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e UserEdges) ParentWithError() (*User, error) {
|
||||
func (e UserEdges) ParentErr() (*User, error) {
|
||||
if e.loadedTypes[1] {
|
||||
if e.Parent == nil {
|
||||
// The edge parent was loaded in eager-loading,
|
||||
@@ -61,9 +61,9 @@ func (e UserEdges) ParentWithError() (*User, error) {
|
||||
return nil, &NotLoadedError{edge: "parent"}
|
||||
}
|
||||
|
||||
// ChildrenWithError returns the Children value or an error if the edge
|
||||
// ChildrenErr returns the Children value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e UserEdges) ChildrenWithError() ([]*User, error) {
|
||||
func (e UserEdges) ChildrenErr() ([]*User, error) {
|
||||
if e.loadedTypes[2] {
|
||||
return e.Children, nil
|
||||
}
|
||||
|
||||
@@ -50,9 +50,9 @@ type CardEdges struct {
|
||||
loadedTypes [2]bool
|
||||
}
|
||||
|
||||
// OwnerWithError returns the Owner value or an error if the edge
|
||||
// OwnerErr returns the Owner value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e CardEdges) OwnerWithError() (*User, error) {
|
||||
func (e CardEdges) OwnerErr() (*User, error) {
|
||||
if e.loadedTypes[0] {
|
||||
if e.Owner == nil {
|
||||
// The edge owner was loaded in eager-loading,
|
||||
@@ -64,9 +64,9 @@ func (e CardEdges) OwnerWithError() (*User, error) {
|
||||
return nil, &NotLoadedError{edge: "owner"}
|
||||
}
|
||||
|
||||
// SpecWithError returns the Spec value or an error if the edge
|
||||
// SpecErr returns the Spec value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e CardEdges) SpecWithError() ([]*Spec, error) {
|
||||
func (e CardEdges) SpecErr() ([]*Spec, error) {
|
||||
if e.loadedTypes[1] {
|
||||
return e.Spec, nil
|
||||
}
|
||||
|
||||
@@ -49,9 +49,9 @@ type FileEdges struct {
|
||||
loadedTypes [2]bool
|
||||
}
|
||||
|
||||
// OwnerWithError returns the Owner value or an error if the edge
|
||||
// OwnerErr returns the Owner value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e FileEdges) OwnerWithError() (*User, error) {
|
||||
func (e FileEdges) OwnerErr() (*User, error) {
|
||||
if e.loadedTypes[0] {
|
||||
if e.Owner == nil {
|
||||
// The edge owner was loaded in eager-loading,
|
||||
@@ -63,9 +63,9 @@ func (e FileEdges) OwnerWithError() (*User, error) {
|
||||
return nil, &NotLoadedError{edge: "owner"}
|
||||
}
|
||||
|
||||
// TypeWithError returns the Type value or an error if the edge
|
||||
// TypeErr returns the Type value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e FileEdges) TypeWithError() (*FileType, error) {
|
||||
func (e FileEdges) TypeErr() (*FileType, error) {
|
||||
if e.loadedTypes[1] {
|
||||
if e.Type == nil {
|
||||
// The edge type was loaded in eager-loading,
|
||||
|
||||
@@ -36,9 +36,9 @@ type FileTypeEdges struct {
|
||||
loadedTypes [1]bool
|
||||
}
|
||||
|
||||
// FilesWithError returns the Files value or an error if the edge
|
||||
// FilesErr returns the Files value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e FileTypeEdges) FilesWithError() ([]*File, error) {
|
||||
func (e FileTypeEdges) FilesErr() ([]*File, error) {
|
||||
if e.loadedTypes[0] {
|
||||
return e.Files, nil
|
||||
}
|
||||
|
||||
@@ -53,36 +53,36 @@ type GroupEdges struct {
|
||||
loadedTypes [4]bool
|
||||
}
|
||||
|
||||
// FilesWithError returns the Files value or an error if the edge
|
||||
// FilesErr returns the Files value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e GroupEdges) FilesWithError() ([]*File, error) {
|
||||
func (e GroupEdges) FilesErr() ([]*File, error) {
|
||||
if e.loadedTypes[0] {
|
||||
return e.Files, nil
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "files"}
|
||||
}
|
||||
|
||||
// BlockedWithError returns the Blocked value or an error if the edge
|
||||
// BlockedErr returns the Blocked value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e GroupEdges) BlockedWithError() ([]*User, error) {
|
||||
func (e GroupEdges) BlockedErr() ([]*User, error) {
|
||||
if e.loadedTypes[1] {
|
||||
return e.Blocked, nil
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "blocked"}
|
||||
}
|
||||
|
||||
// UsersWithError returns the Users value or an error if the edge
|
||||
// UsersErr returns the Users value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e GroupEdges) UsersWithError() ([]*User, error) {
|
||||
func (e GroupEdges) UsersErr() ([]*User, error) {
|
||||
if e.loadedTypes[2] {
|
||||
return e.Users, nil
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "users"}
|
||||
}
|
||||
|
||||
// InfoWithError returns the Info value or an error if the edge
|
||||
// InfoErr returns the Info value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e GroupEdges) InfoWithError() (*GroupInfo, error) {
|
||||
func (e GroupEdges) InfoErr() (*GroupInfo, error) {
|
||||
if e.loadedTypes[3] {
|
||||
if e.Info == nil {
|
||||
// The edge info was loaded in eager-loading,
|
||||
|
||||
@@ -38,9 +38,9 @@ type GroupInfoEdges struct {
|
||||
loadedTypes [1]bool
|
||||
}
|
||||
|
||||
// GroupsWithError returns the Groups value or an error if the edge
|
||||
// GroupsErr returns the Groups value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e GroupInfoEdges) GroupsWithError() ([]*Group, error) {
|
||||
func (e GroupInfoEdges) GroupsErr() ([]*Group, error) {
|
||||
if e.loadedTypes[0] {
|
||||
return e.Groups, nil
|
||||
}
|
||||
|
||||
@@ -39,9 +39,9 @@ type NodeEdges struct {
|
||||
loadedTypes [2]bool
|
||||
}
|
||||
|
||||
// PrevWithError returns the Prev value or an error if the edge
|
||||
// PrevErr returns the Prev value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e NodeEdges) PrevWithError() (*Node, error) {
|
||||
func (e NodeEdges) PrevErr() (*Node, error) {
|
||||
if e.loadedTypes[0] {
|
||||
if e.Prev == nil {
|
||||
// The edge prev was loaded in eager-loading,
|
||||
@@ -53,9 +53,9 @@ func (e NodeEdges) PrevWithError() (*Node, error) {
|
||||
return nil, &NotLoadedError{edge: "prev"}
|
||||
}
|
||||
|
||||
// NextWithError returns the Next value or an error if the edge
|
||||
// NextErr returns the Next value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e NodeEdges) NextWithError() (*Node, error) {
|
||||
func (e NodeEdges) NextErr() (*Node, error) {
|
||||
if e.loadedTypes[1] {
|
||||
if e.Next == nil {
|
||||
// The edge next was loaded in eager-loading,
|
||||
|
||||
@@ -41,9 +41,9 @@ type PetEdges struct {
|
||||
loadedTypes [2]bool
|
||||
}
|
||||
|
||||
// TeamWithError returns the Team value or an error if the edge
|
||||
// TeamErr returns the Team value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e PetEdges) TeamWithError() (*User, error) {
|
||||
func (e PetEdges) TeamErr() (*User, error) {
|
||||
if e.loadedTypes[0] {
|
||||
if e.Team == nil {
|
||||
// The edge team was loaded in eager-loading,
|
||||
@@ -55,9 +55,9 @@ func (e PetEdges) TeamWithError() (*User, error) {
|
||||
return nil, &NotLoadedError{edge: "team"}
|
||||
}
|
||||
|
||||
// OwnerWithError returns the Owner value or an error if the edge
|
||||
// OwnerErr returns the Owner value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e PetEdges) OwnerWithError() (*User, error) {
|
||||
func (e PetEdges) OwnerErr() (*User, error) {
|
||||
if e.loadedTypes[1] {
|
||||
if e.Owner == nil {
|
||||
// The edge owner was loaded in eager-loading,
|
||||
|
||||
@@ -34,9 +34,9 @@ type SpecEdges struct {
|
||||
loadedTypes [1]bool
|
||||
}
|
||||
|
||||
// CardWithError returns the Card value or an error if the edge
|
||||
// CardErr returns the Card value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e SpecEdges) CardWithError() ([]*Card, error) {
|
||||
func (e SpecEdges) CardErr() ([]*Card, error) {
|
||||
if e.loadedTypes[0] {
|
||||
return e.Card, nil
|
||||
}
|
||||
|
||||
@@ -75,9 +75,9 @@ type UserEdges struct {
|
||||
loadedTypes [11]bool
|
||||
}
|
||||
|
||||
// CardWithError returns the Card value or an error if the edge
|
||||
// CardErr returns the Card value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e UserEdges) CardWithError() (*Card, error) {
|
||||
func (e UserEdges) CardErr() (*Card, error) {
|
||||
if e.loadedTypes[0] {
|
||||
if e.Card == nil {
|
||||
// The edge card was loaded in eager-loading,
|
||||
@@ -89,63 +89,63 @@ func (e UserEdges) CardWithError() (*Card, error) {
|
||||
return nil, &NotLoadedError{edge: "card"}
|
||||
}
|
||||
|
||||
// PetsWithError returns the Pets value or an error if the edge
|
||||
// PetsErr returns the Pets value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e UserEdges) PetsWithError() ([]*Pet, error) {
|
||||
func (e UserEdges) PetsErr() ([]*Pet, error) {
|
||||
if e.loadedTypes[1] {
|
||||
return e.Pets, nil
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "pets"}
|
||||
}
|
||||
|
||||
// FilesWithError returns the Files value or an error if the edge
|
||||
// FilesErr returns the Files value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e UserEdges) FilesWithError() ([]*File, error) {
|
||||
func (e UserEdges) FilesErr() ([]*File, error) {
|
||||
if e.loadedTypes[2] {
|
||||
return e.Files, nil
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "files"}
|
||||
}
|
||||
|
||||
// GroupsWithError returns the Groups value or an error if the edge
|
||||
// GroupsErr returns the Groups value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e UserEdges) GroupsWithError() ([]*Group, error) {
|
||||
func (e UserEdges) GroupsErr() ([]*Group, error) {
|
||||
if e.loadedTypes[3] {
|
||||
return e.Groups, nil
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "groups"}
|
||||
}
|
||||
|
||||
// FriendsWithError returns the Friends value or an error if the edge
|
||||
// FriendsErr returns the Friends value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e UserEdges) FriendsWithError() ([]*User, error) {
|
||||
func (e UserEdges) FriendsErr() ([]*User, error) {
|
||||
if e.loadedTypes[4] {
|
||||
return e.Friends, nil
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "friends"}
|
||||
}
|
||||
|
||||
// FollowersWithError returns the Followers value or an error if the edge
|
||||
// FollowersErr returns the Followers value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e UserEdges) FollowersWithError() ([]*User, error) {
|
||||
func (e UserEdges) FollowersErr() ([]*User, error) {
|
||||
if e.loadedTypes[5] {
|
||||
return e.Followers, nil
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "followers"}
|
||||
}
|
||||
|
||||
// FollowingWithError returns the Following value or an error if the edge
|
||||
// FollowingErr returns the Following value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e UserEdges) FollowingWithError() ([]*User, error) {
|
||||
func (e UserEdges) FollowingErr() ([]*User, error) {
|
||||
if e.loadedTypes[6] {
|
||||
return e.Following, nil
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "following"}
|
||||
}
|
||||
|
||||
// TeamWithError returns the Team value or an error if the edge
|
||||
// TeamErr returns the Team value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e UserEdges) TeamWithError() (*Pet, error) {
|
||||
func (e UserEdges) TeamErr() (*Pet, error) {
|
||||
if e.loadedTypes[7] {
|
||||
if e.Team == nil {
|
||||
// The edge team was loaded in eager-loading,
|
||||
@@ -157,9 +157,9 @@ func (e UserEdges) TeamWithError() (*Pet, error) {
|
||||
return nil, &NotLoadedError{edge: "team"}
|
||||
}
|
||||
|
||||
// SpouseWithError returns the Spouse value or an error if the edge
|
||||
// SpouseErr returns the Spouse value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e UserEdges) SpouseWithError() (*User, error) {
|
||||
func (e UserEdges) SpouseErr() (*User, error) {
|
||||
if e.loadedTypes[8] {
|
||||
if e.Spouse == nil {
|
||||
// The edge spouse was loaded in eager-loading,
|
||||
@@ -171,18 +171,18 @@ func (e UserEdges) SpouseWithError() (*User, error) {
|
||||
return nil, &NotLoadedError{edge: "spouse"}
|
||||
}
|
||||
|
||||
// ChildrenWithError returns the Children value or an error if the edge
|
||||
// ChildrenErr returns the Children value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e UserEdges) ChildrenWithError() ([]*User, error) {
|
||||
func (e UserEdges) ChildrenErr() ([]*User, error) {
|
||||
if e.loadedTypes[9] {
|
||||
return e.Children, nil
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "children"}
|
||||
}
|
||||
|
||||
// ParentWithError returns the Parent value or an error if the edge
|
||||
// ParentErr returns the Parent value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e UserEdges) ParentWithError() (*User, error) {
|
||||
func (e UserEdges) ParentErr() (*User, error) {
|
||||
if e.loadedTypes[10] {
|
||||
if e.Parent == nil {
|
||||
// The edge parent was loaded in eager-loading,
|
||||
|
||||
@@ -48,9 +48,9 @@ type CardEdges struct {
|
||||
loadedTypes [2]bool
|
||||
}
|
||||
|
||||
// OwnerWithError returns the Owner value or an error if the edge
|
||||
// OwnerErr returns the Owner value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e CardEdges) OwnerWithError() (*User, error) {
|
||||
func (e CardEdges) OwnerErr() (*User, error) {
|
||||
if e.loadedTypes[0] {
|
||||
if e.Owner == nil {
|
||||
// The edge owner was loaded in eager-loading,
|
||||
@@ -62,9 +62,9 @@ func (e CardEdges) OwnerWithError() (*User, error) {
|
||||
return nil, &NotLoadedError{edge: "owner"}
|
||||
}
|
||||
|
||||
// SpecWithError returns the Spec value or an error if the edge
|
||||
// SpecErr returns the Spec value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e CardEdges) SpecWithError() ([]*Spec, error) {
|
||||
func (e CardEdges) SpecErr() ([]*Spec, error) {
|
||||
if e.loadedTypes[1] {
|
||||
return e.Spec, nil
|
||||
}
|
||||
|
||||
@@ -45,9 +45,9 @@ type FileEdges struct {
|
||||
loadedTypes [2]bool
|
||||
}
|
||||
|
||||
// OwnerWithError returns the Owner value or an error if the edge
|
||||
// OwnerErr returns the Owner value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e FileEdges) OwnerWithError() (*User, error) {
|
||||
func (e FileEdges) OwnerErr() (*User, error) {
|
||||
if e.loadedTypes[0] {
|
||||
if e.Owner == nil {
|
||||
// The edge owner was loaded in eager-loading,
|
||||
@@ -59,9 +59,9 @@ func (e FileEdges) OwnerWithError() (*User, error) {
|
||||
return nil, &NotLoadedError{edge: "owner"}
|
||||
}
|
||||
|
||||
// TypeWithError returns the Type value or an error if the edge
|
||||
// TypeErr returns the Type value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e FileEdges) TypeWithError() (*FileType, error) {
|
||||
func (e FileEdges) TypeErr() (*FileType, error) {
|
||||
if e.loadedTypes[1] {
|
||||
if e.Type == nil {
|
||||
// The edge type was loaded in eager-loading,
|
||||
|
||||
@@ -35,9 +35,9 @@ type FileTypeEdges struct {
|
||||
loadedTypes [1]bool
|
||||
}
|
||||
|
||||
// FilesWithError returns the Files value or an error if the edge
|
||||
// FilesErr returns the Files value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e FileTypeEdges) FilesWithError() ([]*File, error) {
|
||||
func (e FileTypeEdges) FilesErr() ([]*File, error) {
|
||||
if e.loadedTypes[0] {
|
||||
return e.Files, nil
|
||||
}
|
||||
|
||||
@@ -51,36 +51,36 @@ type GroupEdges struct {
|
||||
loadedTypes [4]bool
|
||||
}
|
||||
|
||||
// FilesWithError returns the Files value or an error if the edge
|
||||
// FilesErr returns the Files value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e GroupEdges) FilesWithError() ([]*File, error) {
|
||||
func (e GroupEdges) FilesErr() ([]*File, error) {
|
||||
if e.loadedTypes[0] {
|
||||
return e.Files, nil
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "files"}
|
||||
}
|
||||
|
||||
// BlockedWithError returns the Blocked value or an error if the edge
|
||||
// BlockedErr returns the Blocked value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e GroupEdges) BlockedWithError() ([]*User, error) {
|
||||
func (e GroupEdges) BlockedErr() ([]*User, error) {
|
||||
if e.loadedTypes[1] {
|
||||
return e.Blocked, nil
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "blocked"}
|
||||
}
|
||||
|
||||
// UsersWithError returns the Users value or an error if the edge
|
||||
// UsersErr returns the Users value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e GroupEdges) UsersWithError() ([]*User, error) {
|
||||
func (e GroupEdges) UsersErr() ([]*User, error) {
|
||||
if e.loadedTypes[2] {
|
||||
return e.Users, nil
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "users"}
|
||||
}
|
||||
|
||||
// InfoWithError returns the Info value or an error if the edge
|
||||
// InfoErr returns the Info value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e GroupEdges) InfoWithError() (*GroupInfo, error) {
|
||||
func (e GroupEdges) InfoErr() (*GroupInfo, error) {
|
||||
if e.loadedTypes[3] {
|
||||
if e.Info == nil {
|
||||
// The edge info was loaded in eager-loading,
|
||||
|
||||
@@ -37,9 +37,9 @@ type GroupInfoEdges struct {
|
||||
loadedTypes [1]bool
|
||||
}
|
||||
|
||||
// GroupsWithError returns the Groups value or an error if the edge
|
||||
// GroupsErr returns the Groups value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e GroupInfoEdges) GroupsWithError() ([]*Group, error) {
|
||||
func (e GroupInfoEdges) GroupsErr() ([]*Group, error) {
|
||||
if e.loadedTypes[0] {
|
||||
return e.Groups, nil
|
||||
}
|
||||
|
||||
@@ -38,9 +38,9 @@ type NodeEdges struct {
|
||||
loadedTypes [2]bool
|
||||
}
|
||||
|
||||
// PrevWithError returns the Prev value or an error if the edge
|
||||
// PrevErr returns the Prev value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e NodeEdges) PrevWithError() (*Node, error) {
|
||||
func (e NodeEdges) PrevErr() (*Node, error) {
|
||||
if e.loadedTypes[0] {
|
||||
if e.Prev == nil {
|
||||
// The edge prev was loaded in eager-loading,
|
||||
@@ -52,9 +52,9 @@ func (e NodeEdges) PrevWithError() (*Node, error) {
|
||||
return nil, &NotLoadedError{edge: "prev"}
|
||||
}
|
||||
|
||||
// NextWithError returns the Next value or an error if the edge
|
||||
// NextErr returns the Next value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e NodeEdges) NextWithError() (*Node, error) {
|
||||
func (e NodeEdges) NextErr() (*Node, error) {
|
||||
if e.loadedTypes[1] {
|
||||
if e.Next == nil {
|
||||
// The edge next was loaded in eager-loading,
|
||||
|
||||
@@ -38,9 +38,9 @@ type PetEdges struct {
|
||||
loadedTypes [2]bool
|
||||
}
|
||||
|
||||
// TeamWithError returns the Team value or an error if the edge
|
||||
// TeamErr returns the Team value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e PetEdges) TeamWithError() (*User, error) {
|
||||
func (e PetEdges) TeamErr() (*User, error) {
|
||||
if e.loadedTypes[0] {
|
||||
if e.Team == nil {
|
||||
// The edge team was loaded in eager-loading,
|
||||
@@ -52,9 +52,9 @@ func (e PetEdges) TeamWithError() (*User, error) {
|
||||
return nil, &NotLoadedError{edge: "team"}
|
||||
}
|
||||
|
||||
// OwnerWithError returns the Owner value or an error if the edge
|
||||
// OwnerErr returns the Owner value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e PetEdges) OwnerWithError() (*User, error) {
|
||||
func (e PetEdges) OwnerErr() (*User, error) {
|
||||
if e.loadedTypes[1] {
|
||||
if e.Owner == nil {
|
||||
// The edge owner was loaded in eager-loading,
|
||||
|
||||
@@ -33,9 +33,9 @@ type SpecEdges struct {
|
||||
loadedTypes [1]bool
|
||||
}
|
||||
|
||||
// CardWithError returns the Card value or an error if the edge
|
||||
// CardErr returns the Card value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e SpecEdges) CardWithError() ([]*Card, error) {
|
||||
func (e SpecEdges) CardErr() ([]*Card, error) {
|
||||
if e.loadedTypes[0] {
|
||||
return e.Card, nil
|
||||
}
|
||||
|
||||
@@ -72,9 +72,9 @@ type UserEdges struct {
|
||||
loadedTypes [11]bool
|
||||
}
|
||||
|
||||
// CardWithError returns the Card value or an error if the edge
|
||||
// CardErr returns the Card value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e UserEdges) CardWithError() (*Card, error) {
|
||||
func (e UserEdges) CardErr() (*Card, error) {
|
||||
if e.loadedTypes[0] {
|
||||
if e.Card == nil {
|
||||
// The edge card was loaded in eager-loading,
|
||||
@@ -86,63 +86,63 @@ func (e UserEdges) CardWithError() (*Card, error) {
|
||||
return nil, &NotLoadedError{edge: "card"}
|
||||
}
|
||||
|
||||
// PetsWithError returns the Pets value or an error if the edge
|
||||
// PetsErr returns the Pets value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e UserEdges) PetsWithError() ([]*Pet, error) {
|
||||
func (e UserEdges) PetsErr() ([]*Pet, error) {
|
||||
if e.loadedTypes[1] {
|
||||
return e.Pets, nil
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "pets"}
|
||||
}
|
||||
|
||||
// FilesWithError returns the Files value or an error if the edge
|
||||
// FilesErr returns the Files value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e UserEdges) FilesWithError() ([]*File, error) {
|
||||
func (e UserEdges) FilesErr() ([]*File, error) {
|
||||
if e.loadedTypes[2] {
|
||||
return e.Files, nil
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "files"}
|
||||
}
|
||||
|
||||
// GroupsWithError returns the Groups value or an error if the edge
|
||||
// GroupsErr returns the Groups value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e UserEdges) GroupsWithError() ([]*Group, error) {
|
||||
func (e UserEdges) GroupsErr() ([]*Group, error) {
|
||||
if e.loadedTypes[3] {
|
||||
return e.Groups, nil
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "groups"}
|
||||
}
|
||||
|
||||
// FriendsWithError returns the Friends value or an error if the edge
|
||||
// FriendsErr returns the Friends value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e UserEdges) FriendsWithError() ([]*User, error) {
|
||||
func (e UserEdges) FriendsErr() ([]*User, error) {
|
||||
if e.loadedTypes[4] {
|
||||
return e.Friends, nil
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "friends"}
|
||||
}
|
||||
|
||||
// FollowersWithError returns the Followers value or an error if the edge
|
||||
// FollowersErr returns the Followers value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e UserEdges) FollowersWithError() ([]*User, error) {
|
||||
func (e UserEdges) FollowersErr() ([]*User, error) {
|
||||
if e.loadedTypes[5] {
|
||||
return e.Followers, nil
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "followers"}
|
||||
}
|
||||
|
||||
// FollowingWithError returns the Following value or an error if the edge
|
||||
// FollowingErr returns the Following value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e UserEdges) FollowingWithError() ([]*User, error) {
|
||||
func (e UserEdges) FollowingErr() ([]*User, error) {
|
||||
if e.loadedTypes[6] {
|
||||
return e.Following, nil
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "following"}
|
||||
}
|
||||
|
||||
// TeamWithError returns the Team value or an error if the edge
|
||||
// TeamErr returns the Team value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e UserEdges) TeamWithError() (*Pet, error) {
|
||||
func (e UserEdges) TeamErr() (*Pet, error) {
|
||||
if e.loadedTypes[7] {
|
||||
if e.Team == nil {
|
||||
// The edge team was loaded in eager-loading,
|
||||
@@ -154,9 +154,9 @@ func (e UserEdges) TeamWithError() (*Pet, error) {
|
||||
return nil, &NotLoadedError{edge: "team"}
|
||||
}
|
||||
|
||||
// SpouseWithError returns the Spouse value or an error if the edge
|
||||
// SpouseErr returns the Spouse value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e UserEdges) SpouseWithError() (*User, error) {
|
||||
func (e UserEdges) SpouseErr() (*User, error) {
|
||||
if e.loadedTypes[8] {
|
||||
if e.Spouse == nil {
|
||||
// The edge spouse was loaded in eager-loading,
|
||||
@@ -168,18 +168,18 @@ func (e UserEdges) SpouseWithError() (*User, error) {
|
||||
return nil, &NotLoadedError{edge: "spouse"}
|
||||
}
|
||||
|
||||
// ChildrenWithError returns the Children value or an error if the edge
|
||||
// ChildrenErr returns the Children value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e UserEdges) ChildrenWithError() ([]*User, error) {
|
||||
func (e UserEdges) ChildrenErr() ([]*User, error) {
|
||||
if e.loadedTypes[9] {
|
||||
return e.Children, nil
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "children"}
|
||||
}
|
||||
|
||||
// ParentWithError returns the Parent value or an error if the edge
|
||||
// ParentErr returns the Parent value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e UserEdges) ParentWithError() (*User, error) {
|
||||
func (e UserEdges) ParentErr() (*User, error) {
|
||||
if e.loadedTypes[10] {
|
||||
if e.Parent == nil {
|
||||
// The edge parent was loaded in eager-loading,
|
||||
|
||||
@@ -40,9 +40,9 @@ type UserEdges struct {
|
||||
loadedTypes [3]bool
|
||||
}
|
||||
|
||||
// SpouseWithError returns the Spouse value or an error if the edge
|
||||
// SpouseErr returns the Spouse value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e UserEdges) SpouseWithError() (*User, error) {
|
||||
func (e UserEdges) SpouseErr() (*User, error) {
|
||||
if e.loadedTypes[0] {
|
||||
if e.Spouse == nil {
|
||||
// The edge spouse was loaded in eager-loading,
|
||||
@@ -54,18 +54,18 @@ func (e UserEdges) SpouseWithError() (*User, error) {
|
||||
return nil, &NotLoadedError{edge: "spouse"}
|
||||
}
|
||||
|
||||
// FollowersWithError returns the Followers value or an error if the edge
|
||||
// FollowersErr returns the Followers value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e UserEdges) FollowersWithError() ([]*User, error) {
|
||||
func (e UserEdges) FollowersErr() ([]*User, error) {
|
||||
if e.loadedTypes[1] {
|
||||
return e.Followers, nil
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "followers"}
|
||||
}
|
||||
|
||||
// FollowingWithError returns the Following value or an error if the edge
|
||||
// FollowingErr returns the Following value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e UserEdges) FollowingWithError() ([]*User, error) {
|
||||
func (e UserEdges) FollowingErr() ([]*User, error) {
|
||||
if e.loadedTypes[2] {
|
||||
return e.Following, nil
|
||||
}
|
||||
|
||||
@@ -911,19 +911,19 @@ func EagerLoading(t *testing.T, client *ent.Client) {
|
||||
require.Nil(users[1].Edges.Card)
|
||||
|
||||
edges := users[0].Edges
|
||||
pets, err := edges.PetsWithError()
|
||||
pets, err := edges.PetsErr()
|
||||
require.True(ent.IsNotLoaded(err))
|
||||
require.Nil(pets)
|
||||
groups, err := edges.GroupsWithError()
|
||||
groups, err := edges.GroupsErr()
|
||||
require.True(ent.IsNotLoaded(err))
|
||||
require.Nil(groups)
|
||||
card, err := edges.CardWithError()
|
||||
card, err := edges.CardErr()
|
||||
require.Nil(err)
|
||||
require.NotNil(card)
|
||||
spouse, err := edges.SpouseWithError()
|
||||
spouse, err := edges.SpouseErr()
|
||||
require.Nil(err)
|
||||
require.NotNil(spouse)
|
||||
parent, err := edges.ParentWithError()
|
||||
parent, err := edges.ParentErr()
|
||||
require.True(ent.IsNotFound(err), "loaded but was not found")
|
||||
require.Nil(parent)
|
||||
})
|
||||
|
||||
@@ -35,9 +35,9 @@ type CarEdges struct {
|
||||
loadedTypes [1]bool
|
||||
}
|
||||
|
||||
// OwnerWithError returns the Owner value or an error if the edge
|
||||
// OwnerErr returns the Owner value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e CarEdges) OwnerWithError() (*User, error) {
|
||||
func (e CarEdges) OwnerErr() (*User, error) {
|
||||
if e.loadedTypes[0] {
|
||||
if e.Owner == nil {
|
||||
// The edge owner was loaded in eager-loading,
|
||||
|
||||
@@ -56,9 +56,9 @@ type UserEdges struct {
|
||||
loadedTypes [4]bool
|
||||
}
|
||||
|
||||
// ParentWithError returns the Parent value or an error if the edge
|
||||
// ParentErr returns the Parent value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e UserEdges) ParentWithError() (*User, error) {
|
||||
func (e UserEdges) ParentErr() (*User, error) {
|
||||
if e.loadedTypes[0] {
|
||||
if e.Parent == nil {
|
||||
// The edge parent was loaded in eager-loading,
|
||||
@@ -70,18 +70,18 @@ func (e UserEdges) ParentWithError() (*User, error) {
|
||||
return nil, &NotLoadedError{edge: "parent"}
|
||||
}
|
||||
|
||||
// ChildrenWithError returns the Children value or an error if the edge
|
||||
// ChildrenErr returns the Children value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e UserEdges) ChildrenWithError() ([]*User, error) {
|
||||
func (e UserEdges) ChildrenErr() ([]*User, error) {
|
||||
if e.loadedTypes[1] {
|
||||
return e.Children, nil
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "children"}
|
||||
}
|
||||
|
||||
// SpouseWithError returns the Spouse value or an error if the edge
|
||||
// SpouseErr returns the Spouse value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e UserEdges) SpouseWithError() (*User, error) {
|
||||
func (e UserEdges) SpouseErr() (*User, error) {
|
||||
if e.loadedTypes[2] {
|
||||
if e.Spouse == nil {
|
||||
// The edge spouse was loaded in eager-loading,
|
||||
@@ -93,9 +93,9 @@ func (e UserEdges) SpouseWithError() (*User, error) {
|
||||
return nil, &NotLoadedError{edge: "spouse"}
|
||||
}
|
||||
|
||||
// CarWithError returns the Car value or an error if the edge
|
||||
// CarErr returns the Car value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e UserEdges) CarWithError() (*Car, error) {
|
||||
func (e UserEdges) CarErr() (*Car, error) {
|
||||
if e.loadedTypes[3] {
|
||||
if e.Car == nil {
|
||||
// The edge car was loaded in eager-loading,
|
||||
|
||||
@@ -35,9 +35,9 @@ type CarEdges struct {
|
||||
loadedTypes [1]bool
|
||||
}
|
||||
|
||||
// OwnerWithError returns the Owner value or an error if the edge
|
||||
// OwnerErr returns the Owner value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e CarEdges) OwnerWithError() (*User, error) {
|
||||
func (e CarEdges) OwnerErr() (*User, error) {
|
||||
if e.loadedTypes[0] {
|
||||
if e.Owner == nil {
|
||||
// The edge owner was loaded in eager-loading,
|
||||
|
||||
@@ -51,9 +51,9 @@ type UserEdges struct {
|
||||
loadedTypes [1]bool
|
||||
}
|
||||
|
||||
// CarWithError returns the Car value or an error if the edge
|
||||
// CarErr returns the Car value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e UserEdges) CarWithError() ([]*Car, error) {
|
||||
func (e UserEdges) CarErr() ([]*Car, error) {
|
||||
if e.loadedTypes[0] {
|
||||
return e.Car, nil
|
||||
}
|
||||
|
||||
@@ -40,9 +40,9 @@ type PetEdges struct {
|
||||
loadedTypes [1]bool
|
||||
}
|
||||
|
||||
// OwnerWithError returns the Owner value or an error if the edge
|
||||
// OwnerErr returns the Owner value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e PetEdges) OwnerWithError() (*User, error) {
|
||||
func (e PetEdges) OwnerErr() (*User, error) {
|
||||
if e.loadedTypes[0] {
|
||||
if e.Owner == nil {
|
||||
// The edge owner was loaded in eager-loading,
|
||||
|
||||
@@ -37,18 +37,18 @@ type UserEdges struct {
|
||||
loadedTypes [2]bool
|
||||
}
|
||||
|
||||
// PetsWithError returns the Pets value or an error if the edge
|
||||
// PetsErr returns the Pets value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e UserEdges) PetsWithError() ([]*Pet, error) {
|
||||
func (e UserEdges) PetsErr() ([]*Pet, error) {
|
||||
if e.loadedTypes[0] {
|
||||
return e.Pets, nil
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "pets"}
|
||||
}
|
||||
|
||||
// FriendsWithError returns the Friends value or an error if the edge
|
||||
// FriendsErr returns the Friends value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e UserEdges) FriendsWithError() ([]*User, error) {
|
||||
func (e UserEdges) FriendsErr() ([]*User, error) {
|
||||
if e.loadedTypes[1] {
|
||||
return e.Friends, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user