Use staticcheck for linting

master
Denis Palnitsky 2 years ago
parent 5d9563a701
commit 7b82f62a13
No known key found for this signature in database
GPG Key ID: 37EEC9354AA9FD30

@ -6,9 +6,8 @@ on:
push:
jobs:
build:
name: build and test
test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
@ -18,9 +17,6 @@ jobs:
with:
go-version: 1.18
- name: lint
uses: golangci/golangci-lint-action@v2
- name: Test
run: go test -v ./... -coverprofile="coverage.out"
@ -32,3 +28,13 @@ jobs:
fail_ci_if_error: true # optional (default = false)
verbose: false # optional (default = false)
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: dominikh/staticcheck-action@v1.1.0
with:
version: "2022.1.1"

@ -4,4 +4,4 @@ test:
# Go lint
lint:
golangci-lint run
staticcheck ./...

@ -373,7 +373,7 @@ func BenchmarkRWMutexMapGet(b *testing.B) {
b.StartTimer()
for i := 0; i < b.N; i++ {
mu.RLock()
_, _ = m["foo"]
_ = m["foo"]
mu.RUnlock()
}
}
@ -388,7 +388,7 @@ func BenchmarkRWMutexInterfaceMapGetStruct(b *testing.B) {
b.StartTimer()
for i := 0; i < b.N; i++ {
mu.RLock()
_, _ = m[s]
_ = m[s]
mu.RUnlock()
}
}
@ -402,7 +402,7 @@ func BenchmarkRWMutexInterfaceMapGetString(b *testing.B) {
b.StartTimer()
for i := 0; i < b.N; i++ {
mu.RLock()
_, _ = m["foo"]
_ = m["foo"]
mu.RUnlock()
}
}
@ -450,7 +450,7 @@ func BenchmarkRWMutexMapGetConcurrent(b *testing.B) {
go func() {
for j := 0; j < each; j++ {
mu.RLock()
_, _ = m["foo"]
_ = m["foo"]
mu.RUnlock()
}
wg.Done()

@ -4,5 +4,5 @@
package tools
import (
_ "github.com/golangci/golangci-lint/cmd/golangci-lint"
_ "honnef.co/go/tools/cmd/staticcheck"
)

Loading…
Cancel
Save