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:
Matthew Gabeler-Lee
2021-03-03 13:05:33 -05:00
committed by GitHub
parent 51d19b8e5b
commit c53b45ddb0
191 changed files with 461 additions and 461 deletions

View File

@@ -43,7 +43,7 @@ func Do(ctx context.Context, client *ent.Client) error {
SetName("a8m").
Save(ctx)
if err != nil {
return fmt.Errorf("creating user: %v", err)
return fmt.Errorf("creating user: %w", err)
}
nati, err := client.User.
Create().
@@ -52,7 +52,7 @@ func Do(ctx context.Context, client *ent.Client) error {
SetSpouse(a8m).
Save(ctx)
if err != nil {
return fmt.Errorf("creating user: %v", err)
return fmt.Errorf("creating user: %w", err)
}
// Query the spouse edge.