Skip to content

Commit 2a5bf77

Browse files
committed
fix invalid fmt.Errorf
1 parent 3e9e385 commit 2a5bf77

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

matchers/be_comparable_to_matcher.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package matchers
22

33
import (
44
"bytes"
5+
"errors"
56
"fmt"
67

78
"github.com/google/go-cmp/cmp"
@@ -32,7 +33,7 @@ func (matcher *BeComparableToMatcher) Match(actual any) (success bool, matchErr
3233
if err, ok := r.(error); ok {
3334
matchErr = err
3435
} else if errMsg, ok := r.(string); ok {
35-
matchErr = fmt.Errorf(errMsg)
36+
matchErr = errors.New(errMsg)
3637
}
3738
}
3839
}()

0 commit comments

Comments
 (0)