all: remove pkg/errors

This commit is contained in:
Ariel Mashraki
2021-08-05 16:32:15 +03:00
committed by Ariel Mashraki
parent f0710aa004
commit eb87d64980
21 changed files with 65 additions and 65 deletions

View File

@@ -15,7 +15,6 @@ import (
"entgo.io/ent/examples/traversal/ent/user"
_ "github.com/mattn/go-sqlite3"
"github.com/pkg/errors"
)
func Example_Traversal() {
@@ -224,12 +223,12 @@ func WithTx(ctx context.Context, client *ent.Client, fn func(tx *ent.Tx) error)
}()
if err := fn(tx); err != nil {
if rerr := tx.Rollback(); rerr != nil {
err = errors.Wrapf(err, "rolling back transaction: %v", rerr)
err = fmt.Errorf("rolling back transaction: %w", rerr)
}
return err
}
if err := tx.Commit(); err != nil {
return errors.Wrapf(err, "committing transaction: %v", err)
return fmt.Errorf("committing transaction: %w", err)
}
return nil
}