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:
Ariel Mashraki
2020-01-30 11:12:53 +02:00
committed by GitHub
parent 27935a8c6c
commit 9e760aae58
49 changed files with 203 additions and 203 deletions

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,

View File

@@ -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
}