ent/gen: use error.New for errors without format (#2764)

This commit is contained in:
Sasha Melentyev
2022-07-17 16:50:50 +03:00
committed by GitHub
parent ddc46d34d8
commit 9e0d8af284
35 changed files with 100 additions and 67 deletions

View File

@@ -10,7 +10,7 @@ in the LICENSE file in the root directory of this source tree.
// BeginTx returns a transactional client with specified options.
func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) {
if _, ok := c.driver.(*txDriver); ok {
return nil, fmt.Errorf("ent: cannot start a transaction within a transaction")
return nil, errors.New("ent: cannot start a transaction within a transaction")
}
tx, err := c.driver.(interface {
BeginTx(context.Context, *sql.TxOptions) (dialect.Tx, error)