Maintenance: add more linters to .golangci.yml

This commit is contained in:
Quentin McGaw (desktop)
2021-05-30 03:09:22 +00:00
parent f1b5341f33
commit 82d98c4859
3 changed files with 10 additions and 4 deletions

View File

@@ -37,27 +37,30 @@ linters:
- godot - godot
- goheader - goheader
- goimports - goimports
- golint
- gomnd - gomnd
- goprintffuncname - goprintffuncname
- gosec - gosec
# - goerr113
- gosimple - gosimple
- govet - govet
- importas
- ineffassign - ineffassign
- interfacer
- lll - lll
- maligned
- misspell - misspell
- nakedret - nakedret
- nestif - nestif
- nilerr
- noctx - noctx
- nolintlint - nolintlint
- prealloc - prealloc
- predeclared
- rowserrcheck - rowserrcheck
- scopelint - exportloopref
- sqlclosecheck - sqlclosecheck
- staticcheck - staticcheck
- structcheck - structcheck
- thelper
- tparallel
- typecheck - typecheck
- unconvert - unconvert
- unparam - unparam

View File

@@ -12,6 +12,7 @@ import (
) )
func digestServerModelVersion(t *testing.T, server interface{}, version uint16) string { func digestServerModelVersion(t *testing.T, server interface{}, version uint16) string {
t.Helper()
bytes, err := json.Marshal(server) bytes, err := json.Marshal(server)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
@@ -118,6 +119,7 @@ func Test_versions(t *testing.T) {
} }
func digestServersTimestamp(t *testing.T, servers interface{}, timestamp int64) string { func digestServersTimestamp(t *testing.T, servers interface{}, timestamp int64) string {
t.Helper()
bytes, err := json.Marshal(servers) bytes, err := json.Marshal(servers)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)

View File

@@ -28,6 +28,7 @@ func Test_FilterByPossibilities(t *testing.T) {
for name, testCase := range testCases { for name, testCase := range testCases {
testCase := testCase testCase := testCase
t.Run(name, func(t *testing.T) { t.Run(name, func(t *testing.T) {
t.Parallel()
filtered := FilterByPossibilities(testCase.value, testCase.possibilities) filtered := FilterByPossibilities(testCase.value, testCase.possibilities)
assert.Equal(t, testCase.filtered, filtered) assert.Equal(t, testCase.filtered, filtered)
}) })