Skip to content

Commit 0b81523

Browse files
authored
Merge pull request #286 from thaJeztah/undeprecate_ErrorType
assert, assert/cmp: un-deprecate assert.ErrorType for now
2 parents c5dad8f + 4256834 commit 0b81523

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

assert/assert.go

-2
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,6 @@ func ErrorContains(t TestingT, err error, substring string, msgAndArgs ...interf
284284
// must be called from the goroutine running the test function, not from other
285285
// goroutines created during the test. Use [Check] with [cmp.ErrorType] from other
286286
// goroutines.
287-
//
288-
// Deprecated: Use [ErrorIs]
289287
func ErrorType(t TestingT, err error, expected interface{}, msgAndArgs ...interface{}) {
290288
if ht, ok := t.(helperT); ok {
291289
ht.Helper()

assert/cmp/compare.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ func isNil(obj interface{}, msgFunc func(reflect.Value) string) Comparison {
286286
}
287287

288288
// ErrorType succeeds if err is not nil and is of the expected type.
289+
// New code should use [ErrorIs] instead.
289290
//
290291
// Expected can be one of:
291292
//
@@ -306,8 +307,6 @@ func isNil(obj interface{}, msgFunc func(reflect.Value) string) Comparison {
306307
// reflect.Type
307308
//
308309
// Fails if err does not implement the [reflect.Type].
309-
//
310-
// Deprecated: Use [ErrorIs]
311310
func ErrorType(err error, expected interface{}) Comparison {
312311
return func() Result {
313312
switch expectedType := expected.(type) {

0 commit comments

Comments
 (0)