Skip to content

Commit dc1e6f0

Browse files
authored
Merge pull request #88 from muonsoft/chore/update-golangci-lint
chore: bump golangci-lint to v2.11.4 and fix new linter findings
2 parents 536349e + a9ad6a6 commit dc1e6f0

5 files changed

Lines changed: 7 additions & 4 deletions

File tree

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Run golangci-lint
2727
uses: golangci/golangci-lint-action@v9
2828
with:
29-
version: v2.6.1
29+
version: v2.11.4
3030

3131
- name: Run tests
3232
run: go test -race -v ./...

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,6 @@ This is a pure Go library with no external services or infrastructure dependenci
202202
### Caveats
203203

204204
- `golangci-lint` is installed to `$(go env GOPATH)/bin`. Ensure this is on `PATH` (the VM's `~/.bashrc` exports it).
205-
- The CI workflow (`.github/workflows/tests.yml`) pins `golangci-lint` at **v2.6.1** and Go at **^1.24**. Match these versions locally.
205+
- The CI workflow (`.github/workflows/tests.yml`) pins `golangci-lint` at **v2.11.4** and Go at **^1.24**. Match these versions locally.
206206
- The `.golangci.yml` uses config **version: "2"** (golangci-lint v2 format). Do not use golangci-lint v1.
207207
- No Makefile, Docker, or docker-compose is used. No services need to be started.

example_http_handler_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func ExampleValidator_Validate_httpHandler() {
7878
handler = language.NewMiddleware(handler, language.SupportedLanguages(language.English, language.Russian))
7979

8080
// creating request with the language-specific header
81-
request := httptest.NewRequest(http.MethodPost, "/", strings.NewReader(`{}`))
81+
request := httptest.NewRequestWithContext(context.Background(), http.MethodPost, "/", strings.NewReader(`{}`))
8282
request.Header.Set("Accept-Language", "ru")
8383

8484
recorder := httptest.NewRecorder()

it/choice.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func IsOneOf[T comparable](values ...T) ChoiceConstraint[T] {
3939
if i > 0 {
4040
s.WriteString(", ")
4141
}
42-
s.WriteString(fmt.Sprint(value))
42+
_, _ = fmt.Fprintf(&s, "%v", value)
4343
}
4444

4545
return ChoiceConstraint[T]{

validate/barcodes.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ func decodeUPCE(value string) ([]byte, error) {
132132
if i >= 8 {
133133
return nil, ErrUnexpectedLength
134134
}
135+
if digit < 0 || digit > 9 {
136+
return nil, fmt.Errorf("%w: %q", ErrContainsNonDigit, v)
137+
}
135138
upce = append(upce, byte(digit))
136139
sum += digit
137140
}

0 commit comments

Comments
 (0)