Add golangci-lint to GitHub Actions #1
Pull Request Overview
Adds a new GitHub Actions workflow to run golangci-lint on pushes to master and on pull requests.
- Introduces
.github/workflows/golangci-lint.ymlto automate lint checks. - Configures permissions and sets up Go and the golangci-lint action.
Pin the Go version to a specific release (e.g. 1.21) instead of stable for reproducible CI runs and to avoid unexpected changes when the latest Go version updates.
go-version: 1.21
@ -0,0 +1,25 @@
name:golangci-lint
on:
push:
branches:
The trigger is set to run on commits to master, but the default branch appears to be main. Update the branch filter to main (or both main and master) to ensure the workflow actually runs.
branches:
- main
@ -0,0 +22,4 @@
- name:golangci-lint
uses:golangci/golangci-lint-action@v8
with:
version:v2.1
Consider enabling or configuring caching for Go modules (using cache: true or similar inputs) to speed up lint runs and reduce network overhead.
version: v2.1
cache: true
Something isn't working
Improvements or additions to documentation
This issue or pull request already exists
New feature or request
Good for newcomers
Extra attention is needed
This doesn't seem right
Further information is requested
This will not be worked on
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?