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