Skip to content

Add golangci-lint and modernize Go CI - #66

Open
HashimTheArab wants to merge 5 commits into
Sandertv:masterfrom
lunar-bedrock:ci/golangci-lint-stable-go
Open

HashimTheArab wants to merge 5 commits into
Sandertv:masterfrom
lunar-bedrock:ci/golangci-lint-stable-go

Conversation

@HashimTheArab

@HashimTheArab HashimTheArab commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

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. Enable unused separately 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, and git diff --check passed. The local network tests also passed 25 race-enabled repetitions.

Go 1.22.12 also passed the build and race tests, using -ldflags=-linkmode=external for the older toolchain on current macOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant