all: attempt to make method for shadow checks consistent with 1.12 and 1.13 #1797
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Checklist
PR Structure
otherwise).
services/friendbot
, orall
ordoc
if the changes are broad or impact manypackages.
Thoroughness
This PR adds tests for the most critical parts of the new functionality or fixes.I've updated any docs (developer docs,.md
files, etc... affected by this change). Take a look in the
docs
folder for a given service,like this one.
Release planning
I've updated the relevant CHANGELOG (here for Horizon) ifneeded with deprecations, added features, breaking changes, and DB schema changes.
semver, or if it's mainly a patch change. The PR is targeted at the next
release branch if it's not a patch change.
Summary
Change the
govet.sh
script so that it runs the shadows check the same way for Go 1.12 and Go 1.13 builds, wrapping the shadow analyzer in a tiny main function that catches and ignores theunsafeptr
flag that gets passed through bygo vet
in Go 1.13+.Goal and scope
On a couple occasions we've had builds break after #1778 was merged. The failures reported have only been on Go 1.13. The specific failure seems to be inconsistent and was reported to golang/go#34557. The fact that we've seen this failure only occur on Go 1.13 is curious. It's possible that there's a change in the language that is contributing to that behavior, or it's possible that different way we run the shadow checker for our 1.13 builds is causing tests to be included in some different way.
When I implemented #1778 I had the option of making the 1.12 and 1.13 builds execute the binary the same way like in this PR, or to execute differently like how it was done in #1778. I mostly flipped a coin.
I'm not sure if doing it this other way will yield more consistent go vet runs, but I figure worth a shot before we remove it.
Summary of changes
Known limitations & issues
What shouldn't be reviewed
N/A