Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assert, assert/cmp: un-deprecate assert.ErrorType for now #286

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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