Skip to content
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: remove go1.16 add go1.18 #4284

Merged
merged 8 commits into from
Mar 21, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update staticcheck
  • Loading branch information
leighmcculloch committed Mar 15, 2022
commit 244a8e85adc5162d2e4d6270d59d48a02d9f7e83
15 changes: 3 additions & 12 deletions staticcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ set -e

gover=$(go version | { read _ _ gover _; printf $gover; })

version='2020.1.4'
if [[ "$gover" = "go1.18"* ]]; then
version='d5c28addcbbbafca0b9a0f9ad8957912e9371015'
fi
# This unreleased version of staticcheck has support for Go 1.18.
# TODO: Update this to v3.0.0 when released.
version='d5c28addcbbbafca0b9a0f9ad8957912e9371015'

staticcheck='go run honnef.co/go/tools/cmd/staticcheck@'"$version"

Expand All @@ -15,11 +14,3 @@ printf "Running staticcheck $version...\n"
ls -d */ \
| egrep -v '^vendor|^docs' \
| xargs -I {} $staticcheck -tests=false -checks="all,-ST1003,-SA1019,-ST1005,-ST1000,-ST1016,-S1039,-ST1021,-ST1020,-ST1019,-SA4022" ./{}...

# 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