Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
encoding/gob: mis-decodes pointers to int 0 to nil pointers #23498
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
Thanks, I understand why that's the case, but it's surprising (to me at least) that gob doesn't round-trip the struct back to the same thing as the original. The obvious workaround indeed is to use another layer of struct, but while that's easy in this case, it'd have been nice not to have to work out why the two things weren't equivalant.
The problem is that vet complains about 0 as a Printf flag in some situations where fmt allows it but probably shouldn't. The two need to be brought in line, but it's too late in the release cycle. The situation is messy and should be resolved properly in 1.11. This CL is a simple fix to disable a spurious complaint for 1.10 that will be resolved in a more thorough way in 1.11. The workaround is just to be silent about flag 0, as suggested in issue 23605. Fixes #23605 Update #23498 Change-Id: Ice1a4f4d86845d70c1340a0a6430d74e5de9afd4 Reviewed-on: https://go-review.googlesource.com/90695 Run-TryBot: Rob Pike <email@example.com> TryBot-Result: Gobot Gobot <firstname.lastname@example.org> Reviewed-by: Ian Lance Taylor <email@example.com>