diff --git a/.golangci.yml b/.golangci.yml index 5d9665e..042d5f7 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -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 ``" - 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: diff --git a/fingerprint.go b/fingerprint.go index aef80a2..8aeb6ff 100644 --- a/fingerprint.go +++ b/fingerprint.go @@ -22,8 +22,9 @@ var ErrFingerprintMismatch = errors.New("fingerprint check failed") var Fingerprint FingerprintAttr const ( - fingerprintXORValue uint32 = 0x5354554e //nolint:staticcheck - fingerprintSize = 4 // 32 bit + //nolint:staticcheck // explicit type + fingerprintXORValue uint32 = 0x5354554e + fingerprintSize = 4 // 32 bit ) // FingerprintValue returns CRC-32 of b XOR-ed by 0x5354554e. diff --git a/xor.go b/xor.go index 34365eb..994c06a 100644 --- a/xor.go +++ b/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) }