Skip to content

Commit

Permalink
update documentation for the Error function in assert or require pack…
Browse files Browse the repository at this point in the history
  • Loading branch information
architagr committed Nov 2, 2024
1 parent 07bac60 commit 2eca2b1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions assert/assertions.go
Original file line number Diff line number Diff line change
Expand Up @@ -1591,10 +1591,8 @@ func NoError(t TestingT, err error, msgAndArgs ...interface{}) bool {

// Error asserts that a function returned an error (i.e. not `nil`).
//
// actualObj, err := SomeFunction()
// if assert.Error(t, err) {
// assert.Equal(t, expectedError, err)
// }
// actualObj, err := SomeFunction()
// assert.Error(t, err)
func Error(t TestingT, err error, msgAndArgs ...interface{}) bool {
if err == nil {
if h, ok := t.(tHelper); ok {
Expand Down

0 comments on commit 2eca2b1

Please sign in to comment.