require.NoError does not work for given example

Open
#762 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Stale
Tech stack
go
Domain
testing

Research direction

Start with the require.NoError entry documented at the linked godoc page and compare its example with assert.NoError. Check the existing require.NoError API and related tests; done means the documented example matches supported behavior and any agreed return-value behavior is covered.

Written by the indexing model from the issue text.

Description

documentation

viewing https://godoc.org/github.com/stretchr/testify/require#NoError

gives the example

actualObj, err := SomeFunction()
  if assert.NoError(err) {
	   assert.Equal(t, expectedObj, actualObj)
  }

but require.NoError does not return a value . (also the example shows assert, though it should be about require)

IMO require.NoError should return a bool to match assert.NoError

let me know if you want a PR to fix.

Dominant language
Go
Stars
26.2k
Forks
1.9k
Avg merge
2d 4h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stretchr/testify

All issues in stretchr/testify

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.