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:
@@ -35,9 +35,9 @@ type CityEdges struct {
|
||||
loadedTypes [1]bool
|
||||
}
|
||||
|
||||
// StreetsWithError returns the Streets value or an error if the edge
|
||||
// StreetsErr returns the Streets value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e CityEdges) StreetsWithError() ([]*Street, error) {
|
||||
func (e CityEdges) StreetsErr() ([]*Street, error) {
|
||||
if e.loadedTypes[0] {
|
||||
return e.Streets, nil
|
||||
}
|
||||
|
||||
@@ -37,9 +37,9 @@ type StreetEdges struct {
|
||||
loadedTypes [1]bool
|
||||
}
|
||||
|
||||
// CityWithError returns the City value or an error if the edge
|
||||
// CityErr returns the City value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e StreetEdges) CityWithError() (*City, error) {
|
||||
func (e StreetEdges) CityErr() (*City, error) {
|
||||
if e.loadedTypes[0] {
|
||||
if e.City == nil {
|
||||
// The edge city was loaded in eager-loading,
|
||||
|
||||
@@ -35,9 +35,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
|
||||
}
|
||||
|
||||
@@ -37,9 +37,9 @@ type UserEdges 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 UserEdges) GroupsWithError() ([]*Group, error) {
|
||||
func (e UserEdges) GroupsErr() ([]*Group, error) {
|
||||
if e.loadedTypes[0] {
|
||||
return e.Groups, nil
|
||||
}
|
||||
|
||||
@@ -37,9 +37,9 @@ type UserEdges struct {
|
||||
loadedTypes [1]bool
|
||||
}
|
||||
|
||||
// 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[0] {
|
||||
return e.Friends, nil
|
||||
}
|
||||
|
||||
@@ -39,18 +39,18 @@ type UserEdges struct {
|
||||
loadedTypes [2]bool
|
||||
}
|
||||
|
||||
// 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[0] {
|
||||
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[1] {
|
||||
return e.Following, nil
|
||||
}
|
||||
|
||||
@@ -37,9 +37,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,9 +37,9 @@ type UserEdges struct {
|
||||
loadedTypes [1]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
|
||||
}
|
||||
|
||||
@@ -38,9 +38,9 @@ type NodeEdges struct {
|
||||
loadedTypes [2]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 NodeEdges) ParentWithError() (*Node, error) {
|
||||
func (e NodeEdges) ParentErr() (*Node, error) {
|
||||
if e.loadedTypes[0] {
|
||||
if e.Parent == nil {
|
||||
// The edge parent was loaded in eager-loading,
|
||||
@@ -52,9 +52,9 @@ func (e NodeEdges) ParentWithError() (*Node, 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 NodeEdges) ChildrenWithError() ([]*Node, error) {
|
||||
func (e NodeEdges) ChildrenErr() ([]*Node, error) {
|
||||
if e.loadedTypes[1] {
|
||||
return e.Children, nil
|
||||
}
|
||||
|
||||
@@ -40,9 +40,9 @@ type CardEdges 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 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,
|
||||
|
||||
@@ -38,9 +38,9 @@ type UserEdges 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, 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,
|
||||
|
||||
@@ -38,9 +38,9 @@ type UserEdges struct {
|
||||
loadedTypes [1]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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -40,9 +40,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,
|
||||
|
||||
@@ -35,9 +35,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
|
||||
}
|
||||
|
||||
@@ -39,18 +39,18 @@ type UserEdges struct {
|
||||
loadedTypes [2]bool
|
||||
}
|
||||
|
||||
// CarsWithError returns the Cars value or an error if the edge
|
||||
// CarsErr returns the Cars value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e UserEdges) CarsWithError() ([]*Car, error) {
|
||||
func (e UserEdges) CarsErr() ([]*Car, error) {
|
||||
if e.loadedTypes[0] {
|
||||
return e.Cars, nil
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "cars"}
|
||||
}
|
||||
|
||||
// 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[1] {
|
||||
return e.Groups, nil
|
||||
}
|
||||
|
||||
@@ -39,18 +39,18 @@ type GroupEdges struct {
|
||||
loadedTypes [2]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
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "users"}
|
||||
}
|
||||
|
||||
// AdminWithError returns the Admin value or an error if the edge
|
||||
// AdminErr returns the Admin value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e GroupEdges) AdminWithError() (*User, error) {
|
||||
func (e GroupEdges) AdminErr() (*User, error) {
|
||||
if e.loadedTypes[1] {
|
||||
if e.Admin == nil {
|
||||
// The edge admin was loaded in eager-loading,
|
||||
|
||||
@@ -39,18 +39,18 @@ type PetEdges struct {
|
||||
loadedTypes [2]bool
|
||||
}
|
||||
|
||||
// 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 PetEdges) FriendsWithError() ([]*Pet, error) {
|
||||
func (e PetEdges) FriendsErr() ([]*Pet, error) {
|
||||
if e.loadedTypes[0] {
|
||||
return e.Friends, nil
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "friends"}
|
||||
}
|
||||
|
||||
// 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,
|
||||
|
||||
@@ -43,36 +43,36 @@ type UserEdges struct {
|
||||
loadedTypes [4]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
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "friends"}
|
||||
}
|
||||
|
||||
// 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[2] {
|
||||
return e.Groups, nil
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "groups"}
|
||||
}
|
||||
|
||||
// ManageWithError returns the Manage value or an error if the edge
|
||||
// ManageErr returns the Manage value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e UserEdges) ManageWithError() ([]*Group, error) {
|
||||
func (e UserEdges) ManageErr() ([]*Group, error) {
|
||||
if e.loadedTypes[3] {
|
||||
return e.Manage, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user