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: Show warning when StructTags not space-separated #9500
Comments
The fix for this issue (golang/tools@682ca03) introduced a new one. Something like
isn't working any more, due to the extra space in the quoted value string. At least in my interpretation of the docs (speaking of quoted string literals) this should be valid. |
Bugged me too, I made a patch for this zimmski/tools@4b82084 and I will try to bring it upstream. |
I forgot to post the CL here https://go-review.googlesource.com/#/c/2974/ |
Please review https://go-review.googlesource.com/3952 for the |
@robpike: I do not get it. Why does https://go-review.googlesource.com/3952 get reviewed and https://go-review.googlesource.com/#/c/2974/ does not? Is there some kind of rule I am missing? |
On 5 February 2015 at 19:28, Markus Zimmermann notifications@github.com
You never mailed 2974 for review. |
I used |
On 5 February 2015 at 19:38, Markus Zimmermann notifications@github.com
|
@dsymonds: Sorry to be a burden here, but what is the sign for mail? Because the CL is in the category "Outgoing reviews" under "My Changes" so I do not know the indication that something is missing. And what should I do with it now? Besides some test cases and the control character handling it is the same. |
As far as I can tell 2974 was sent out. I see it here: https://groups.google.com/forum/#!searchin/golang-codereviews/2974/golang-codereviews/hVZNIPvazNY/YISaX9QxKbkJ . I think the main issue is that no reviewer was assigned and nobody happened to pick it up. For 3952 Nigel assigned Rob as the reviewer when he sent it out, so Rob got it in direct mail, and reviewed it quickly. That is, CL 2974 would have been reviewed at some point, but 3952 was reviewed quickly because it was sent directly to the reviewer. |
If I visit https://go-review.googlesource.com/#/c/2974/, the first thing in
the History section is "Uploaded patch set 1.". That's why I thought it
hadn't been mailed. But it looks like that's the standard text, so I expect
Ian's hypothesis is the reason.
|
The validateStructTag code now closely mimics the StructTag.Get code in package reflect. This addresses the comment raised on issue #9500: golang/go#9500 (comment) See also https://go-review.googlesource.com/3953 Change-Id: I583f7447dbc5a2d7ecbb393d9bb6b1515cb10b18 Reviewed-on: https://go-review.googlesource.com/3952 Reviewed-by: Rob Pike <r@golang.org>
@zimmski, Ian's hypothesis sounds plausible to me. From my point of view, I didn't realize that this bug existed (and hence that your code change was proposed) until I'd actually written the patch. (I came across this bug independently). Once I had my change (to the golang.org/x/tools repo), and the matching change to the main Go repo, it seemed faster to send both of my changes out instead of reviewing yours, especially as your new code differed from the StructTag.Get code in the standard reflect package and I'd prefer them to be similar. Apologies for having your proposal fall through the cracks. |
Separately, this issue was closed by golang/tools@682ca03 |
If StructTags are separated via tabs rather than spaces, they will not work... but
go vet
will not issue any warnings.Example code (Github does not appear to render tabs and spaces differently though):
Playground example: https://play.golang.org/p/DAvrKtIBKI
This issue was requested by @robpike: https://twitter.com/rob_pike/status/551313510991265792
The text was updated successfully, but these errors were encountered: