Skip to content

Commit

Permalink
Merge pull request #286 from thaJeztah/undeprecate_ErrorType
Browse files Browse the repository at this point in the history
assert, assert/cmp: un-deprecate assert.ErrorType for now
  • Loading branch information
dnephin authored Sep 5, 2024
2 parents c5dad8f + 4256834 commit 0b81523
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 0 additions & 2 deletions assert/assert.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,6 @@ func ErrorContains(t TestingT, err error, substring string, msgAndArgs ...interf
// must be called from the goroutine running the test function, not from other
// goroutines created during the test. Use [Check] with [cmp.ErrorType] from other
// goroutines.
//
// Deprecated: Use [ErrorIs]
func ErrorType(t TestingT, err error, expected interface{}, msgAndArgs ...interface{}) {
if ht, ok := t.(helperT); ok {
ht.Helper()
Expand Down
3 changes: 1 addition & 2 deletions assert/cmp/compare.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ func isNil(obj interface{}, msgFunc func(reflect.Value) string) Comparison {
}

// ErrorType succeeds if err is not nil and is of the expected type.
// New code should use [ErrorIs] instead.
//
// Expected can be one of:
//
Expand All @@ -306,8 +307,6 @@ func isNil(obj interface{}, msgFunc func(reflect.Value) string) Comparison {
// reflect.Type
//
// Fails if err does not implement the [reflect.Type].
//
// Deprecated: Use [ErrorIs]
func ErrorType(err error, expected interface{}) Comparison {
return func() Result {
switch expectedType := expected.(type) {
Expand Down

0 comments on commit 0b81523

Please sign in to comment.