-
Notifications
You must be signed in to change notification settings - Fork 815
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #879 from 99designs/add-golangci-lint
Add golangci-lint and fix linting issues
- Loading branch information
Showing
27 changed files
with
125 additions
and
109 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,35 @@ | ||
name: Continuous Integration | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
- master | ||
jobs: | ||
|
||
build: | ||
name: Build | ||
test: | ||
name: test | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.17 | ||
- uses: actions/checkout@v3 | ||
- name: Run tests | ||
run: go test -race ./... | ||
lint: | ||
name: lint | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macOS-latest] | ||
|
||
os: [macos-latest, ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
|
||
- name: Set up Go 1.17 | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.17 | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v3 | ||
|
||
- name: Run tests | ||
run: go test -race ./... | ||
|
||
- name: Check go vet | ||
run: go vet ./... | ||
|
||
- name: Check go fmt | ||
run: diff -u <(echo -n) <(gofmt -s -d .) | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.17 | ||
- uses: actions/checkout@v3 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
version: v1.44.2 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
linters: | ||
enable: | ||
- bodyclose | ||
- contextcheck | ||
- deadcode | ||
- depguard | ||
- durationcheck | ||
- dupl | ||
- errcheck | ||
- errchkjson | ||
- errname | ||
- exhaustive | ||
- exportloopref | ||
- gofmt | ||
- goimports | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- makezero | ||
- misspell | ||
- nakedret | ||
- nilerr | ||
- nilnil | ||
- noctx | ||
- prealloc | ||
- revive | ||
- rowserrcheck | ||
- staticcheck | ||
- structcheck | ||
- thelper | ||
- tparallel | ||
- typecheck | ||
- unconvert | ||
- unparam | ||
- unused | ||
- varcheck | ||
- wastedassign | ||
- whitespace |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.