Skip to content

Commit

Permalink
Update assert/assertions.go
Browse files Browse the repository at this point in the history
Co-authored-by: Bracken <abdawson@gmail.com>
  • Loading branch information
JERHAV and brackendawson committed Mar 4, 2024
1 parent 626b60c commit e4ac99d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions assert/assertions.go
Expand Up @@ -55,8 +55,8 @@ func CreateErrorIsAssertionFunc(target error) ErrorAssertionFunc {
}
}

// CreateErrorIsAssertionFunc returns an [ErrorAssertionFunc] which tests if the error follows an specific interface
func CreateErrorAsAssertionFunc(expectedInterface interface{}) ErrorAssertionFunc {
// CreateErrorIsAssertionFunc returns an [ErrorAssertionFunc] which tests if the any error in err's tree matches target and if so, assigns it to target. The returned function panics if target is not a non-nil pointer to either a type that implements error, or to any interface type.
func CreateErrorAsAssertionFunc(target interface{}) ErrorAssertionFunc {
return func(t TestingT, err error, i ...interface{}) bool {
return ErrorAs(t, err, expectedInterface, i...)

Check failure on line 61 in assert/assertions.go

View workflow job for this annotation

GitHub Actions / build (stable)

undefined: expectedInterface

Check failure on line 61 in assert/assertions.go

View workflow job for this annotation

GitHub Actions / test (1.18)

undefined: expectedInterface

Check failure on line 61 in assert/assertions.go

View workflow job for this annotation

GitHub Actions / test (1.19)

undefined: expectedInterface

Check failure on line 61 in assert/assertions.go

View workflow job for this annotation

GitHub Actions / test (1.20)

undefined: expectedInterface

Check failure on line 61 in assert/assertions.go

View workflow job for this annotation

GitHub Actions / test (1.21)

undefined: expectedInterface
}
Expand Down

0 comments on commit e4ac99d

Please sign in to comment.