mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
all: use %w instead of %v to wrap errors (#1275)
* all: use %w instead of %v for nested errors with fmt.Errorf * all: update generated code to use %w instead of %v for error wrapping
This commit is contained in:
committed by
GitHub
parent
51d19b8e5b
commit
c53b45ddb0
@@ -416,7 +416,7 @@ func (gq *GroupQuery) sqlAll(ctx context.Context) ([]*Group, error) {
|
||||
},
|
||||
}
|
||||
if err := sqlgraph.QueryEdges(ctx, gq.driver, _spec); err != nil {
|
||||
return nil, fmt.Errorf(`query edges "users": %v`, err)
|
||||
return nil, fmt.Errorf(`query edges "users": %w`, err)
|
||||
}
|
||||
query.Where(user.IDIn(edgeids...))
|
||||
neighbors, err := query.All(ctx)
|
||||
@@ -445,7 +445,7 @@ func (gq *GroupQuery) sqlCount(ctx context.Context) (int, error) {
|
||||
func (gq *GroupQuery) sqlExist(ctx context.Context) (bool, error) {
|
||||
n, err := gq.sqlCount(ctx)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("ent: check existence: %v", err)
|
||||
return false, fmt.Errorf("ent: check existence: %w", err)
|
||||
}
|
||||
return n > 0, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user