entc/gen: change <E>Err signature to <E>OrErr (#325)

Signed-off-by: Alex Snast <alexsn@fb.com>
This commit is contained in:
Alex Snast
2020-01-30 17:56:36 +01:00
committed by GitHub
parent 0802e0b4f5
commit e6ba06441b
49 changed files with 203 additions and 203 deletions

View File

@@ -40,9 +40,9 @@ type CarEdges struct {
loadedTypes [1]bool
}
// OwnerErr returns the Owner value or an error if the edge
// OwnerOrErr 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) OwnerErr() (*User, error) {
func (e CarEdges) OwnerOrErr() (*User, error) {
if e.loadedTypes[0] {
if e.Owner == nil {
// The edge owner was loaded in eager-loading,

View File

@@ -35,9 +35,9 @@ type GroupEdges struct {
loadedTypes [1]bool
}
// UsersErr returns the Users value or an error if the edge
// UsersOrErr returns the Users value or an error if the edge
// was not loaded in eager-loading.
func (e GroupEdges) UsersErr() ([]*User, error) {
func (e GroupEdges) UsersOrErr() ([]*User, error) {
if e.loadedTypes[0] {
return e.Users, nil
}

View File

@@ -39,18 +39,18 @@ type UserEdges struct {
loadedTypes [2]bool
}
// CarsErr returns the Cars value or an error if the edge
// CarsOrErr returns the Cars value or an error if the edge
// was not loaded in eager-loading.
func (e UserEdges) CarsErr() ([]*Car, error) {
func (e UserEdges) CarsOrErr() ([]*Car, error) {
if e.loadedTypes[0] {
return e.Cars, nil
}
return nil, &NotLoadedError{edge: "cars"}
}
// GroupsErr returns the Groups value or an error if the edge
// GroupsOrErr returns the Groups value or an error if the edge
// was not loaded in eager-loading.
func (e UserEdges) GroupsErr() ([]*Group, error) {
func (e UserEdges) GroupsOrErr() ([]*Group, error) {
if e.loadedTypes[1] {
return e.Groups, nil
}