Repository navigation
Add golangci-lint and modernize Go CI - #66
Open
HashimTheArab wants to merge 5 commits into
Open
HashimTheArab wants to merge 5 commits into
HashimTheArab wants to merge 5 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Replace the separate vet and Staticcheck steps with the official
golangci/golangci-lint-action@v9, pinned to golangci-lint v2.13.2. Lint runs in its own job, following gophertunnel's setup. Enableunusedseparately to preserve the previous Staticcheck dead-code checks, and omit redundant settings. Both jobs use stable Go; the module's Go requirement stays unchanged.CI also runs race-enabled tests and builds every package. The workflow supports pushes, pull requests, and manual runs, uses read-only permissions, disables persisted checkout credentials, cancels superseded runs, and limits each job to 15 minutes.
The existing network tests and executable ping example now use local listeners on available ports: the previous Mineplex dependency intermittently timed out during validation. Public-server examples use
play.inpvp.net:19132. The remaining source changes are the embedded-field selector and whitespace fixes required by lint.Validation with Go 1.27.1: golangci-lint v2.13.2's release binary reported zero issues;
go test -race ./...,go build ./..., configuration validation,actionlint, andgit diff --checkpassed. The local network tests also passed 25 race-enabled repetitions.Go 1.22.12 also passed the build and race tests, using
-ldflags=-linkmode=externalfor the older toolchain on current macOS.