Skip to content

Commit

Permalink
chore: use errors.New to replace fmt.Errorf with no parameters (#32800)
Browse files Browse the repository at this point in the history
use errors.New to replace fmt.Errorf with no parameters

Signed-off-by: RiceChuan <lc582041246@gmail.com>
  • Loading branch information
RiceChuan authored Dec 12, 2024
1 parent ee45950 commit dfd7594
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions models/db/context_committer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
package db // it's not db_test, because this file is for testing the private type halfCommitter

import (
"fmt"
"errors"
"testing"

"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -80,7 +80,7 @@ func Test_halfCommitter(t *testing.T) {
testWithCommitter(mockCommitter, func(committer Committer) error {
defer committer.Close()
if true {
return fmt.Errorf("error")
return errors.New("error")
}
return committer.Commit()
})
Expand All @@ -94,7 +94,7 @@ func Test_halfCommitter(t *testing.T) {
testWithCommitter(mockCommitter, func(committer Committer) error {
committer.Close()
committer.Commit()
return fmt.Errorf("error")
return errors.New("error")
})

mockCommitter.Assert(t)
Expand Down

0 comments on commit dfd7594

Please # to comment.