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: behavioral difference on unkeyed field detection #25453
Comments
Ok, another very funky thing: On our CI run, |
That is correct. The reasoning is that if it's a local type, the people maintaining the code are also the people maintaining the declared types. For example, unkeyed composite literals are very helpful when writing long tables, such as those used in test cases. However, that is not documented very well:
I'll send a patch to clarify it. As for Windows - could you double check that the amd64 vs 386 weirdness still happens with the small reproducer you pasted above? |
Change https://golang.org/cl/113755 mentions this issue: |
@mvdan I'll try to set up a new repo with just these 2 repro files and let appveyor do its stuff. |
No, my small repro https://github.com/karalabe/govetrepro seems to work fine on all Windows architectures https://ci.appveyor.com/project/karalabe/govetrepro . Not sure what went wrong on the Ethereum CI. Anyway, I think it's safe to close this issue and I'll reopen if we ever experience it again. |
It could well be a bug in vet, but without having a Windows machine myself to test, it's hard to debug that weirdness. Yes, I agree that we should close this for now, until we have more information. |
The check has worked this way for a long time, but it has never been well documented. For #25453. Change-Id: If603e53348ba51f73b2f449b943c6f97f64aa3eb Reviewed-on: https://go-review.googlesource.com/113755 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org>
What version of Go are you using (
go version
)?go version go1.10.1 linux/amd64
Does this issue reproduce with the latest release?
I guess.
What operating system and processor architecture are you using (
go env
)?What did you do?
Create two packages:
What did you expect to see?
When running
go vet
against these two package, I'd expect either both to fail withcomposite literal uses unkeyed fields
or none of them.What did you see instead?
Seems packages are allowed to use unkeyed fields locally, but not remotely. This seems like an odd thing to allow tbh.
The text was updated successfully, but these errors were encountered: