Skip to content
This repository was archived by the owner on Jun 5, 2021. It is now read-only.

Commit 6c9f9fb

Browse files
committed
all: fix lint issues
1 parent 06fd809 commit 6c9f9fb

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
lines changed

.golangci.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# v1.22.2
12
linters-settings:
23
govet:
34
check-shadowing: true
@@ -32,8 +33,7 @@ issues:
3233
- "`assertHMACSize` - `blocksize` always receives `64`"
3334
exclude-rules:
3435
- text: "string `<nil>`"
35-
linters:
36-
- goconst
36+
linters: [goconst]
3737

3838
# Exclude some linters from running on tests files.
3939
- path: _test\.go
@@ -43,23 +43,23 @@ issues:
4343
- dupl
4444
- gosec
4545
- goconst
46+
- funlen
47+
- gocognit
48+
- gomnd
4649

4750
# Ease some gocritic warnings on test files.
4851
- path: _test\.go
4952
text: "(unnamedResult|exitAfterDefer|unlambda)"
50-
linters:
51-
- gocritic
53+
linters: [gocritic]
5254

5355
# Exclude known linters from partially hard-vendored code,
5456
# which is impossible to exclude via "nolint" comments.
5557
- path: internal/hmac/
5658
text: "weak cryptographic primitive"
57-
linters:
58-
- gosec
59+
linters: [gosec]
5960
- path: internal/hmac/
6061
text: "Write\\` is not checked"
61-
linters:
62-
- errcheck
62+
linters: [errcheck]
6363

6464
# Ease linting on benchmarking code.
6565
- path: cmd/stun-bench/
@@ -71,10 +71,12 @@ issues:
7171
- path: ^cmd/
7272
linters:
7373
- gocyclo
74+
- gocognit
75+
- gomnd
7476
- path: ^cmd/
7577
text: "(unnamedResult|exitAfterDefer)"
76-
linters:
77-
- gocritic
78+
linters: [gocritic]
79+
7880
- text: evalOrder
7981
path: helpers
8082
source: "Build"
@@ -85,6 +87,10 @@ linters:
8587
- prealloc
8688
- gochecknoglobals
8789
- scopelint
90+
- funlen
91+
- wsl
92+
- godox
93+
- gomnd
8894

8995
run:
9096
skip-dirs:

fingerprint.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ var ErrFingerprintMismatch = errors.New("fingerprint check failed")
2222
var Fingerprint FingerprintAttr
2323

2424
const (
25-
fingerprintXORValue uint32 = 0x5354554e //nolint:staticcheck
26-
fingerprintSize = 4 // 32 bit
25+
//nolint:staticcheck // explicit type
26+
fingerprintXORValue uint32 = 0x5354554e
27+
fingerprintSize = 4 // 32 bit
2728
)
2829

2930
// FingerprintValue returns CRC-32 of b XOR-ed by 0x5354554e.

xor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func safeXORBytes(dst, a, b []byte) int {
5454

5555
// xorBytes xors the bytes in a and b. The destination is assumed to have enough
5656
// space. Returns the number of bytes xor'd.
57-
func xorBytes(dst, a, b []byte) int {
57+
func xorBytes(dst, a, b []byte) int { //nolint:unparam // code from std
5858
if supportsUnaligned {
5959
return fastXORBytes(dst, a, b)
6060
}

0 commit comments

Comments
 (0)