Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unreachable code error not shown #37

Open
Cosby86 opened this issue Oct 5, 2017 · 9 comments
Open

Unreachable code error not shown #37

Cosby86 opened this issue Oct 5, 2017 · 9 comments

Comments

@Cosby86
Copy link

Cosby86 commented Oct 5, 2017

Hello,
I've the following gometalinter entry in my gometalinter's report:
<error column="0" line="93" message="unreachable code" severity="error" source="vet"></error>

but this isn't shown in sonar.
Can you kindly add this rule?

@Blackmage89
Copy link

Yes it would be really helpful to see these kinds of errors.

@thibaultfalque
Copy link
Collaborator

Hi,
I will add.
Thanks for your feedback.

@Cosby86
Copy link
Author

Cosby86 commented Oct 6, 2017

Thank youl. I don't know if the regexp is the same but, the vet errors should be added:

<error column="0" line="186" message="possible misuse of unsafe.Pointer" severity="error" source="vet"/>

<error column="0" line="12" message="this return statement may be reached without using the backgroundcancel var defined on line 11" severity="error" source="vet"/>

<error column="0" line="11" message="the backgroundcancel function is not used on all paths (possible context leak)" severity="error" source="vet"/>

<error column="0" line="14" message="NotificationEventsHandler passes lock by value: sync.WaitGroup contains sync.noCopy" severity="error" source="vet"/>

Thank you for your kind support

@thibaultfalque
Copy link
Collaborator

Can you test this solution for resolve the problem with the rules unreachable code?

@Cosby86
Copy link
Author

Cosby86 commented Oct 6, 2017

I just tested it. It worked fine. I have the "unreachable code" in the sonar report. Thank you. Let me know if I can support you for adding other errors.

Kind regards

thibaultfalque pushed a commit that referenced this issue Oct 10, 2017
@danielleberre
Copy link
Contributor

@Cosby86 could you close the issue now that the problem is fixed?

@Cosby86
Copy link
Author

Cosby86 commented Oct 16, 2017

Hi danielle I'm waiting for the other errors support:

<error column="0" line="186" message="possible misuse of unsafe.Pointer" severity="error" source="vet"/>

<error column="0" line="12" message="this return statement may be reached without using the backgroundcancel var defined on line 11" severity="error" source="vet"/>

<error column="0" line="11" message="the backgroundcancel function is not used on all paths (possible context leak)" severity="error" source="vet"/>

<error column="0" line="14" message="NotificationEventsHandler passes lock by value: sync.WaitGroup contains sync.noCopy" severity="error" source="vet"/>

Are those errors already implemented?

@danielleberre
Copy link
Contributor

@thibaultfalque could we add the above vet errors in the plugin to close that issue?

@thibaultfalque
Copy link
Collaborator

hi @Cosby86 and @danielleberre the first and the last error are present (0046571).

I will add the other rules but I don't find the rules in vet page (https://golang.org/cmd/vet/).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants