Skip to content

Commit

Permalink
Clarify documentation for NotErrorIs assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
palsivertsen committed Nov 30, 2021
1 parent 12747cb commit 5a5b06e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion assert/assertion_format.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ func NotErrorAsf(t TestingT, err error, target interface{}, msg string, args ...
}

// NotErrorIsf asserts that at none of the errors in err's chain matches target.
// This is a wrapper for errors.Is.
// This is the inverse of the ErrorIs function.
func NotErrorIsf(t TestingT, err error, target error, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
Expand Down
4 changes: 2 additions & 2 deletions assert/assertion_forward.go
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ func (a *Assertions) NotErrorAsf(err error, target interface{}, msg string, args
}

// NotErrorIs asserts that at none of the errors in err's chain matches target.
// This is a wrapper for errors.Is.
// This is the inverse of the ErrorIs function.
func (a *Assertions) NotErrorIs(err error, target error, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
Expand All @@ -1147,7 +1147,7 @@ func (a *Assertions) NotErrorIs(err error, target error, msgAndArgs ...interface
}

// NotErrorIsf asserts that at none of the errors in err's chain matches target.
// This is a wrapper for errors.Is.
// This is the inverse of the ErrorIs function.
func (a *Assertions) NotErrorIsf(err error, target error, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
Expand Down
2 changes: 1 addition & 1 deletion assert/assertions.go
Original file line number Diff line number Diff line change
Expand Up @@ -1761,7 +1761,7 @@ func ErrorIs(t TestingT, err, target error, msgAndArgs ...interface{}) bool {
}

// NotErrorIs asserts that at none of the errors in err's chain matches target.
// This is a wrapper for errors.Is.
// This is the inverse of the ErrorIs function.
func NotErrorIs(t TestingT, err, target error, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
Expand Down
4 changes: 2 additions & 2 deletions require/require.go
Original file line number Diff line number Diff line change
Expand Up @@ -1451,7 +1451,7 @@ func NotErrorAsf(t TestingT, err error, target interface{}, msg string, args ...
}

// NotErrorIs asserts that at none of the errors in err's chain matches target.
// This is a wrapper for errors.Is.
// This is the inverse of the ErrorIs function.
func NotErrorIs(t TestingT, err error, target error, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
Expand All @@ -1463,7 +1463,7 @@ func NotErrorIs(t TestingT, err error, target error, msgAndArgs ...interface{})
}

// NotErrorIsf asserts that at none of the errors in err's chain matches target.
// This is a wrapper for errors.Is.
// This is the inverse of the ErrorIs function.
func NotErrorIsf(t TestingT, err error, target error, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
Expand Down
4 changes: 2 additions & 2 deletions require/require_forward.go
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@ func (a *Assertions) NotErrorAsf(err error, target interface{}, msg string, args
}

// NotErrorIs asserts that at none of the errors in err's chain matches target.
// This is a wrapper for errors.Is.
// This is the inverse of the ErrorIs function.
func (a *Assertions) NotErrorIs(err error, target error, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
Expand All @@ -1148,7 +1148,7 @@ func (a *Assertions) NotErrorIs(err error, target error, msgAndArgs ...interface
}

// NotErrorIsf asserts that at none of the errors in err's chain matches target.
// This is a wrapper for errors.Is.
// This is the inverse of the ErrorIs function.
func (a *Assertions) NotErrorIsf(err error, target error, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
Expand Down

0 comments on commit 5a5b06e

Please sign in to comment.