mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-22 15:23:14 -05:00
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> (cherry picked from commit dfd75944992fc6508ec891b4c29715c23e59e4ed)
This commit is contained in:
parent
bf934c96c9
commit
c3d37894aa
1 changed files with 3 additions and 3 deletions
|
@ -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"
|
||||
|
@ -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()
|
||||
})
|
||||
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue