@@ -671,8 +671,6 @@ func Greaterf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...in
671671// body that contains a string.
672672//
673673// require.HTTPBodyContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky")
674- //
675- // Returns whether the assertion was successful (true) or not (false).
676674func HTTPBodyContains (t TestingT , handler http.HandlerFunc , method string , url string , values url.Values , str interface {}, msgAndArgs ... interface {}) {
677675 if h , ok := t .(tHelper ); ok {
678676 h .Helper ()
@@ -687,8 +685,6 @@ func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method string, url s
687685// body that contains a string.
688686//
689687// require.HTTPBodyContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted")
690- //
691- // Returns whether the assertion was successful (true) or not (false).
692688func HTTPBodyContainsf (t TestingT , handler http.HandlerFunc , method string , url string , values url.Values , str interface {}, msg string , args ... interface {}) {
693689 if h , ok := t .(tHelper ); ok {
694690 h .Helper ()
@@ -703,8 +699,6 @@ func HTTPBodyContainsf(t TestingT, handler http.HandlerFunc, method string, url
703699// body that does not contain a string.
704700//
705701// require.HTTPBodyNotContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky")
706- //
707- // Returns whether the assertion was successful (true) or not (false).
708702func HTTPBodyNotContains (t TestingT , handler http.HandlerFunc , method string , url string , values url.Values , str interface {}, msgAndArgs ... interface {}) {
709703 if h , ok := t .(tHelper ); ok {
710704 h .Helper ()
@@ -719,8 +713,6 @@ func HTTPBodyNotContains(t TestingT, handler http.HandlerFunc, method string, ur
719713// body that does not contain a string.
720714//
721715// require.HTTPBodyNotContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted")
722- //
723- // Returns whether the assertion was successful (true) or not (false).
724716func HTTPBodyNotContainsf (t TestingT , handler http.HandlerFunc , method string , url string , values url.Values , str interface {}, msg string , args ... interface {}) {
725717 if h , ok := t .(tHelper ); ok {
726718 h .Helper ()
@@ -734,8 +726,6 @@ func HTTPBodyNotContainsf(t TestingT, handler http.HandlerFunc, method string, u
734726// HTTPError asserts that a specified handler returns an error status code.
735727//
736728// require.HTTPError(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}}
737- //
738- // Returns whether the assertion was successful (true) or not (false).
739729func HTTPError (t TestingT , handler http.HandlerFunc , method string , url string , values url.Values , msgAndArgs ... interface {}) {
740730 if h , ok := t .(tHelper ); ok {
741731 h .Helper ()
@@ -749,8 +739,6 @@ func HTTPError(t TestingT, handler http.HandlerFunc, method string, url string,
749739// HTTPErrorf asserts that a specified handler returns an error status code.
750740//
751741// require.HTTPErrorf(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}}
752- //
753- // Returns whether the assertion was successful (true) or not (false).
754742func HTTPErrorf (t TestingT , handler http.HandlerFunc , method string , url string , values url.Values , msg string , args ... interface {}) {
755743 if h , ok := t .(tHelper ); ok {
756744 h .Helper ()
@@ -764,8 +752,6 @@ func HTTPErrorf(t TestingT, handler http.HandlerFunc, method string, url string,
764752// HTTPRedirect asserts that a specified handler returns a redirect status code.
765753//
766754// require.HTTPRedirect(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}}
767- //
768- // Returns whether the assertion was successful (true) or not (false).
769755func HTTPRedirect (t TestingT , handler http.HandlerFunc , method string , url string , values url.Values , msgAndArgs ... interface {}) {
770756 if h , ok := t .(tHelper ); ok {
771757 h .Helper ()
@@ -779,8 +765,6 @@ func HTTPRedirect(t TestingT, handler http.HandlerFunc, method string, url strin
779765// HTTPRedirectf asserts that a specified handler returns a redirect status code.
780766//
781767// require.HTTPRedirectf(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}}
782- //
783- // Returns whether the assertion was successful (true) or not (false).
784768func HTTPRedirectf (t TestingT , handler http.HandlerFunc , method string , url string , values url.Values , msg string , args ... interface {}) {
785769 if h , ok := t .(tHelper ); ok {
786770 h .Helper ()
@@ -794,8 +778,6 @@ func HTTPRedirectf(t TestingT, handler http.HandlerFunc, method string, url stri
794778// HTTPStatusCode asserts that a specified handler returns a specified status code.
795779//
796780// require.HTTPStatusCode(t, myHandler, "GET", "/notImplemented", nil, 501)
797- //
798- // Returns whether the assertion was successful (true) or not (false).
799781func HTTPStatusCode (t TestingT , handler http.HandlerFunc , method string , url string , values url.Values , statuscode int , msgAndArgs ... interface {}) {
800782 if h , ok := t .(tHelper ); ok {
801783 h .Helper ()
@@ -809,8 +791,6 @@ func HTTPStatusCode(t TestingT, handler http.HandlerFunc, method string, url str
809791// HTTPStatusCodef asserts that a specified handler returns a specified status code.
810792//
811793// require.HTTPStatusCodef(t, myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted")
812- //
813- // Returns whether the assertion was successful (true) or not (false).
814794func HTTPStatusCodef (t TestingT , handler http.HandlerFunc , method string , url string , values url.Values , statuscode int , msg string , args ... interface {}) {
815795 if h , ok := t .(tHelper ); ok {
816796 h .Helper ()
@@ -824,8 +804,6 @@ func HTTPStatusCodef(t TestingT, handler http.HandlerFunc, method string, url st
824804// HTTPSuccess asserts that a specified handler returns a success status code.
825805//
826806// require.HTTPSuccess(t, myHandler, "POST", "http://www.google.com", nil)
827- //
828- // Returns whether the assertion was successful (true) or not (false).
829807func HTTPSuccess (t TestingT , handler http.HandlerFunc , method string , url string , values url.Values , msgAndArgs ... interface {}) {
830808 if h , ok := t .(tHelper ); ok {
831809 h .Helper ()
@@ -839,8 +817,6 @@ func HTTPSuccess(t TestingT, handler http.HandlerFunc, method string, url string
839817// HTTPSuccessf asserts that a specified handler returns a success status code.
840818//
841819// require.HTTPSuccessf(t, myHandler, "POST", "http://www.google.com", nil, "error message %s", "formatted")
842- //
843- // Returns whether the assertion was successful (true) or not (false).
844820func HTTPSuccessf (t TestingT , handler http.HandlerFunc , method string , url string , values url.Values , msg string , args ... interface {}) {
845821 if h , ok := t .(tHelper ); ok {
846822 h .Helper ()
@@ -1387,10 +1363,9 @@ func NoDirExistsf(t TestingT, path string, msg string, args ...interface{}) {
13871363
13881364// NoError asserts that a function returned a nil error (ie. no error).
13891365//
1390- // actualObj, err := SomeFunction()
1391- // if require.NoError(t, err) {
1392- // require.Equal(t, expectedObj, actualObj)
1393- // }
1366+ // actualObj, err := SomeFunction()
1367+ // require.NoError(t, err)
1368+ // require.Equal(t, expectedObj, actualObj)
13941369func NoError (t TestingT , err error , msgAndArgs ... interface {}) {
13951370 if h , ok := t .(tHelper ); ok {
13961371 h .Helper ()
@@ -1403,10 +1378,9 @@ func NoError(t TestingT, err error, msgAndArgs ...interface{}) {
14031378
14041379// NoErrorf asserts that a function returned a nil error (ie. no error).
14051380//
1406- // actualObj, err := SomeFunction()
1407- // if require.NoErrorf(t, err, "error message %s", "formatted") {
1408- // require.Equal(t, expectedObj, actualObj)
1409- // }
1381+ // actualObj, err := SomeFunction()
1382+ // require.NoErrorf(t, err, "error message %s", "formatted")
1383+ // require.Equal(t, expectedObj, actualObj)
14101384func NoErrorf (t TestingT , err error , msg string , args ... interface {}) {
14111385 if h , ok := t .(tHelper ); ok {
14121386 h .Helper ()
@@ -1515,9 +1489,8 @@ func NotElementsMatchf(t TestingT, listA interface{}, listB interface{}, msg str
15151489
15161490// NotEmpty asserts that the specified object is NOT [Empty].
15171491//
1518- // if require.NotEmpty(t, obj) {
1519- // require.Equal(t, "two", obj[1])
1520- // }
1492+ // require.NotEmpty(t, obj)
1493+ // require.Equal(t, "two", obj[1])
15211494func NotEmpty (t TestingT , object interface {}, msgAndArgs ... interface {}) {
15221495 if h , ok := t .(tHelper ); ok {
15231496 h .Helper ()
@@ -1530,9 +1503,8 @@ func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) {
15301503
15311504// NotEmptyf asserts that the specified object is NOT [Empty].
15321505//
1533- // if require.NotEmptyf(t, obj, "error message %s", "formatted") {
1534- // require.Equal(t, "two", obj[1])
1535- // }
1506+ // require.NotEmptyf(t, obj, "error message %s", "formatted")
1507+ // require.Equal(t, "two", obj[1])
15361508func NotEmptyf (t TestingT , object interface {}, msg string , args ... interface {}) {
15371509 if h , ok := t .(tHelper ); ok {
15381510 h .Helper ()
0 commit comments