Add SelectorName in UncheckedError#197
Conversation
|
@kisielk Could you please review this? One more attempt to integrate with golangci-lint |
|
Looks good to me. Would you mind also adding a test to the test suite? |
c3c70a7 to
89d00e3
Compare
sure, will add |
89d00e3 to
aeac866
Compare
|
@kisielk I added a very simple test, that the original line should contain the selectorName. Is it good enough? |
|
That is ok for now I think. The tests need a bit of a revamp to look for the specific test data anyway.. Let me check with the other maintainers if this change is ok then we can merge. |
|
Thanks |
dtcaciuc
left a comment
There was a problem hiding this comment.
Basically what Kamil already said, current check seems more like a smoke test, but doesn't look like we can do much more without involved refactoring. LGTM
|
we can write a test to test only the selectorName function, but I didn't;t figure out how to properly create the ast Tree to cover all cases. I will try to work on it |
|
@SVilgelm I wouldn't worry about it for now, I don't really want to test un-exported functions, we just need to go through and restructure the existing tests. |
|
@kisielk @dtcaciuc thank you! It works fine: golangci/golangci-lint#1319 |
|
I've tagged v1.6.0 |
Added a
SelectorNamefield in theUncheckedErrorstruct to store the original func name.We cannot integrate the
errcheckerlinter with thegolangci-linttool without this changes, we have an additional exclude ofos.Stdout|Stderr.Write, but thefullNamefunction returns(*os.File).Writeand ignoringos.Fileis not acceptable.