From 2eca2b1976672aef09e63f0ab56329bc33a2fb5c Mon Sep 17 00:00:00 2001 From: Archit Agarwal Date: Sun, 3 Nov 2024 02:19:05 +0530 Subject: [PATCH] update documentation for the Error function in assert or require package #1609 --- assert/assertions.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/assert/assertions.go b/assert/assertions.go index 4e91332bb..295144d14 100644 --- a/assert/assertions.go +++ b/assert/assertions.go @@ -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 {