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

cmd/vet: check for tautological comparisons #16693

Closed
masiulaniec opened this issue Aug 14, 2016 · 2 comments
Closed

cmd/vet: check for tautological comparisons #16693

masiulaniec opened this issue Aug 14, 2016 · 2 comments

Comments

@masiulaniec
Copy link

@masiulaniec masiulaniec commented Aug 14, 2016

Report expressions such as:

if a.someLongField != a.someLongField { ... }
@creachadair

This comment has been minimized.

Copy link

@creachadair creachadair commented Aug 15, 2016

Wouldn't that depend on the type of a.someLongField? If it's a float, for example, that's not tautological (because of NaN).

@ALTree

This comment has been minimized.

Copy link
Member

@ALTree ALTree commented Aug 15, 2016

Dup of #15586

@josharian josharian closed this Aug 15, 2016
@golang golang locked and limited conversation to collaborators Aug 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.