mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: change <E>Err signature to <E>OrErr (#325)
Signed-off-by: Alex Snast <alexsn@fb.com>
This commit is contained in:
@@ -40,9 +40,9 @@ type CardEdges 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 CardEdges) OwnerErr() (*User, error) {
|
||||
func (e CardEdges) OwnerOrErr() (*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
|
||||
}
|
||||
|
||||
// CardErr returns the Card value or an error if the edge
|
||||
// CardOrErr 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) CardErr() (*Card, error) {
|
||||
func (e UserEdges) CardOrErr() (*Card, error) {
|
||||
if e.loadedTypes[0] {
|
||||
if e.Card == nil {
|
||||
// The edge card was loaded in eager-loading,
|
||||
|
||||
Reference in New Issue
Block a user