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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user