Skip to content

question: why no autofix for require-error and go-require ? #147

Closed Answered by Antonboom
ccoVeille asked this question in Q&A
Discussion options

You must be logged in to vote

require-error requires a lot of context around. There are many patterns with conditional asserts, group of asserts, etc. But to be honest these patterns are ignored and we can fix warned asserts. The single issue here assert objects – you cannot fix code like

assrtObj := assert.New(t)
assrtObj.NoError(t, err)

because there is no reqObj instead.

For go-require we have not common pattern for fixing. In most cases you need to rewrite test at all and make goroutine free from any assertions.

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by ccoVeille
Comment options

You must be logged in to vote
4 replies
@Antonboom
Comment options

@ccoVeille
Comment options

@Antonboom
Comment options

@ccoVeille
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #132 on June 21, 2024 17:09.