gocrest icon indicating copy to clipboard operation
gocrest copied to clipboard

does a NoError() matcher make sense?

Open nitram509 opened this issue 2 years ago • 1 comments

Hi,

since foo, err := bar() is a typical go style, I wonder, if a NoError() matcher would make sense to add?

Example

foo, err := bar()
then.assertThat(t, err, is.NoError())

What do you think? I would be open to create a PR ... but would like to get your view first :)

nitram509 avatar Jul 17 '22 10:07 nitram509

Thanks for your idea.

I think this would be fine. You could implement it as a wrapper around is.not(is.nil()). Go for it 👍

Edit: it might be better as has.NoError()

corbym avatar Jul 17 '22 21:07 corbym

My motivation for contribution is too low as of now ... closing this issue ... anyone else is free to pick it up :)

nitram509 avatar Dec 20 '22 13:12 nitram509