Fix lint errors, update loopvar-related linters #1341

Merged
fyrchik merged 3 commits from fyrchik/frostfs-node:fix-linter into master 2024-08-28 15:44:44 +00:00

3 commits

Author SHA1 Message Date
f8c6e05e1c [#1341] .golangci.yml: Replace exportloopref with copyloopvar
All checks were successful
Tests and linters / Run gofumpt (pull_request) Successful in 1m56s
DCO action / DCO (pull_request) Successful in 2m15s
Vulncheck / Vulncheck (pull_request) Successful in 2m24s
Tests and linters / Tests (1.22) (pull_request) Successful in 2m54s
Build / Build Components (1.22) (pull_request) Successful in 2m53s
Build / Build Components (1.23) (pull_request) Successful in 2m52s
Tests and linters / Lint (pull_request) Successful in 3m24s
Pre-commit hooks / Pre-commit (pull_request) Successful in 3m3s
Tests and linters / Tests (1.23) (pull_request) Successful in 3m22s
Tests and linters / Staticcheck (pull_request) Successful in 3m25s
Tests and linters / gopls check (pull_request) Successful in 4m0s
Tests and linters / Tests with -race (pull_request) Successful in 4m12s
exportloopref is deprecated.
gopatch:
```
@@
var index, value identifier
var slice expression
@@
for index, value := range slice {
...
-value := value
...
}

@@
var index, value identifier
var slice expression
@@
for index, value := range slice {
...
-index := index
...
}

@@
var value identifier
var channel expression
@@
for value := range channel {
...
-value := value
...
}
```

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-08-28 15:00:05 +03:00
8fd26595a8 [#1341] Makefile: Update golangci-lint
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-08-28 14:50:48 +03:00
b96720ece5 [#1341] Makefile: Build linter with -trimpath
Fix error with go1.23:
```
Error: build linters: unable to load custom analyzer "truecloudlab-linters": ../linters/bin/external_linters.so, plugin.Open("/repo/frostfs/linters/bin/external_linters"): plugin was built with a different version of package cmp
Failed executing command with error: build linters: unable to load custom analyzer "truecloudlab-linters": ../linters/bin/external_linters.so, plugin.Open("/repo/frostfs/linters/bin/external_linters"): plugin was built with a different version of package cmp
```

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-08-28 14:50:48 +03:00