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/gofmt: "a && b != 2" doesn't match "x != 1 && x != 2" #18987

Closed
mdempsky opened this issue Feb 7, 2017 · 2 comments
Closed

cmd/gofmt: "a && b != 2" doesn't match "x != 1 && x != 2" #18987

mdempsky opened this issue Feb 7, 2017 · 2 comments
Milestone

Comments

@mdempsky
Copy link
Member

@mdempsky mdempsky commented Feb 7, 2017

I would expect "a && b != 2" to match against "x != 1 && x != 2", but it doesn't:

$ cat /tmp/blah.go
package p

func f(x int) bool {
	return x != 1 && x != 2
}

$ gofmt -r 'a && b != 2 -> a' /tmp/blah.go
package p

func f(x int) bool {
	return x != 1 && x != 2
}
@mdempsky mdempsky added this to the Go1.9 milestone Feb 7, 2017
@mdempsky
Copy link
Member Author

@mdempsky mdempsky commented Feb 7, 2017

@gopherbot
Copy link

@gopherbot gopherbot commented Feb 7, 2017

CL https://golang.org/cl/36546 mentions this issue.

@gopherbot gopherbot closed this in e410d2a Feb 8, 2017
@golang golang locked and limited conversation to collaborators Feb 8, 2018
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
2 participants
You can’t perform that action at this time.