mirror of
https://github.com/gortc/stun.git
synced 2025-09-26 20:41:36 +08:00
all: fix lint issues
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
# v1.22.2
|
||||
linters-settings:
|
||||
govet:
|
||||
check-shadowing: true
|
||||
@@ -32,8 +33,7 @@ issues:
|
||||
- "`assertHMACSize` - `blocksize` always receives `64`"
|
||||
exclude-rules:
|
||||
- text: "string `<nil>`"
|
||||
linters:
|
||||
- goconst
|
||||
linters: [goconst]
|
||||
|
||||
# Exclude some linters from running on tests files.
|
||||
- path: _test\.go
|
||||
@@ -43,23 +43,23 @@ issues:
|
||||
- dupl
|
||||
- gosec
|
||||
- goconst
|
||||
- funlen
|
||||
- gocognit
|
||||
- gomnd
|
||||
|
||||
# Ease some gocritic warnings on test files.
|
||||
- path: _test\.go
|
||||
text: "(unnamedResult|exitAfterDefer|unlambda)"
|
||||
linters:
|
||||
- gocritic
|
||||
linters: [gocritic]
|
||||
|
||||
# Exclude known linters from partially hard-vendored code,
|
||||
# which is impossible to exclude via "nolint" comments.
|
||||
- path: internal/hmac/
|
||||
text: "weak cryptographic primitive"
|
||||
linters:
|
||||
- gosec
|
||||
linters: [gosec]
|
||||
- path: internal/hmac/
|
||||
text: "Write\\` is not checked"
|
||||
linters:
|
||||
- errcheck
|
||||
linters: [errcheck]
|
||||
|
||||
# Ease linting on benchmarking code.
|
||||
- path: cmd/stun-bench/
|
||||
@@ -71,10 +71,12 @@ issues:
|
||||
- path: ^cmd/
|
||||
linters:
|
||||
- gocyclo
|
||||
- gocognit
|
||||
- gomnd
|
||||
- path: ^cmd/
|
||||
text: "(unnamedResult|exitAfterDefer)"
|
||||
linters:
|
||||
- gocritic
|
||||
linters: [gocritic]
|
||||
|
||||
- text: evalOrder
|
||||
path: helpers
|
||||
source: "Build"
|
||||
@@ -85,6 +87,10 @@ linters:
|
||||
- prealloc
|
||||
- gochecknoglobals
|
||||
- scopelint
|
||||
- funlen
|
||||
- wsl
|
||||
- godox
|
||||
- gomnd
|
||||
|
||||
run:
|
||||
skip-dirs:
|
||||
|
@@ -22,7 +22,8 @@ var ErrFingerprintMismatch = errors.New("fingerprint check failed")
|
||||
var Fingerprint FingerprintAttr
|
||||
|
||||
const (
|
||||
fingerprintXORValue uint32 = 0x5354554e //nolint:staticcheck
|
||||
//nolint:staticcheck // explicit type
|
||||
fingerprintXORValue uint32 = 0x5354554e
|
||||
fingerprintSize = 4 // 32 bit
|
||||
)
|
||||
|
||||
|
2
xor.go
2
xor.go
@@ -54,7 +54,7 @@ func safeXORBytes(dst, a, b []byte) int {
|
||||
|
||||
// xorBytes xors the bytes in a and b. The destination is assumed to have enough
|
||||
// space. Returns the number of bytes xor'd.
|
||||
func xorBytes(dst, a, b []byte) int {
|
||||
func xorBytes(dst, a, b []byte) int { //nolint:unparam // code from std
|
||||
if supportsUnaligned {
|
||||
return fastXORBytes(dst, a, b)
|
||||
}
|
||||
|
Reference in New Issue
Block a user