Skip to content

Commit dfd7594

Browse files
authored
chore: use errors.New to replace fmt.Errorf with no parameters (#32800)
use errors.New to replace fmt.Errorf with no parameters Signed-off-by: RiceChuan <lc582041246@gmail.com>
1 parent ee45950 commit dfd7594

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

models/db/context_committer_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
package db // it's not db_test, because this file is for testing the private type halfCommitter
55

66
import (
7-
"fmt"
7+
"errors"
88
"testing"
99

1010
"github.com/stretchr/testify/assert"
@@ -80,7 +80,7 @@ func Test_halfCommitter(t *testing.T) {
8080
testWithCommitter(mockCommitter, func(committer Committer) error {
8181
defer committer.Close()
8282
if true {
83-
return fmt.Errorf("error")
83+
return errors.New("error")
8484
}
8585
return committer.Commit()
8686
})
@@ -94,7 +94,7 @@ func Test_halfCommitter(t *testing.T) {
9494
testWithCommitter(mockCommitter, func(committer Committer) error {
9595
committer.Close()
9696
committer.Commit()
97-
return fmt.Errorf("error")
97+
return errors.New("error")
9898
})
9999

100100
mockCommitter.Assert(t)

0 commit comments

Comments
 (0)