-
Notifications
You must be signed in to change notification settings - Fork 504
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
all: run builds and tests with go1.18rc1 #4143
Changes from all commits
e2e26a9
d3434e2
2b1161e
3674d36
e431266
a4a1682
caf49af
a0c35d2
ee1007e
d612f1a
9ee69b5
c4473be
e700f87
0951c73
403e437
797bcbd
3861d32
f1b5f39
76fa11a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
#! /bin/bash | ||
set -e | ||
|
||
gover=$(go version | { read _ _ gover _; printf $gover; }) | ||
|
||
version='2020.1.4' | ||
if [[ "$gover" = "go1.18"* ]]; then | ||
version='d5c28addcbbbafca0b9a0f9ad8957912e9371015' | ||
fi | ||
|
||
staticcheck='go run honnef.co/go/tools/cmd/staticcheck@'"$version" | ||
|
||
printf "Running staticcheck $version...\n" | ||
|
@@ -10,6 +16,10 @@ ls -d */ \ | |
| egrep -v '^vendor|^docs' \ | ||
| xargs -I {} $staticcheck -tests=false -checks="all,-ST1003,-SA1019,-ST1005,-ST1000,-ST1016,-S1039,-ST1021,-ST1020,-ST1019,-SA4022" ./{}... | ||
|
||
|
||
# Check horizon for unused exported symbols (relying on the fact that it should be self-contained) | ||
$staticcheck -unused.whole-program -checks='U*' ./services/horizon/... | ||
# Whole program unused checks were removed from staticcheck in newer versions, | ||
# so this check is being sunset and will be removed once Go 1.18 is released and | ||
# a proper release of staticcheck is released that supports it. | ||
if [ "$version" = "2020.1.4" ]; then | ||
# Check horizon for unused exported symbols (relying on the fact that it should be self-contained) | ||
$staticcheck -unused.whole-program -checks='U*' ./services/horizon/... | ||
fi | ||
Comment on lines
+19
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI @stellar/horizon-committers. We'll be losing this check in the very near future because it was removed from staticcheck sometime ago. When Go 1.18 is released we'll upgrade our version of staticcheck and that version won't have the whole program unused check anymore. See dominikh/go-tools@5cfc85b. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out of curiosity do you know why
1.16.7
isn't included in this check job but is in the build and test jobs below? wondering if it's something we can remove below as well to speed up the workflow time (or should have here as well)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We support the last two versions of Go, but checks can change from one version to the next in subtle ways and there's little value in running the checks twice. What's more important is running tests and building against the previous version to be sure that we aren't using an API that isn't supported in the previous version, or to detect subtle API changes. Subtle API changes are so rare in Go that we probably will never see a error.