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
go/printer: (a + b * *p) contracts to (a + b**p) #13025
Comments
I will give it a try. |
The current outcome seems perfectly logical to me. What result is proposed instead? |
@cznic The result is "perfectly logical" but is not great from a readability point of view as mentioned before.
does seem clearer than
(a**b means a to the power of b in some languages, and we even use that notation in some comments to mean that). |
The What about |
AFAIK so far gofmt without |
I've thought a bit more about this and decided that this is not worth the special handling. For one, @cznic 's suggestion is a perfectly good Go solution: If the situation arises and readability is a concern, adding ()'s is the work-around. Secondly, in the std lib (under GOROOT/src) there appears only a single occurrence of this pattern, and in that case spaces are present. src/runtime/map_test.go:382:26:
(I didn't find any occurrences under x/arch, x/build, x/net, x/oauth2, x/review, x/sys, and x/tools). |
http://play.golang.org/p/TL4gjjbxS6
This is unfortunate and probably should be fixed. Go doesn't have a ** operator so there's no parsing issue, but it is a readability issue in my mind.
The text was updated successfully, but these errors were encountered: