Skip to content

Commit b4cf28f

Browse files
committed
align local go lint with CI and fix staticcheck warning
1 parent 7ffd9dc commit b4cf28f

2 files changed

Lines changed: 5 additions & 14 deletions

File tree

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
.PHONY: build build-debug build-release clean test test-go test-rust test-all lint lint-go lint-rust fmt fmt-go fmt-rust help
22

3+
GOLANGCI_LINT_VERSION := v2.5.0
4+
GOLANGCI_LINT_CMD := go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
5+
36
UNAME_S := $(shell uname -s 2>/dev/null || echo UNKNOWN)
47
OS_ENV := $(OS)
58

@@ -106,7 +109,7 @@ test-all: test-go test-rust
106109
lint: lint-go lint-rust
107110

108111
lint-go:
109-
golangci-lint run ./...
112+
$(GOLANGCI_LINT_CMD) run --timeout=5m ./...
110113

111114
lint-rust:
112115
cargo clippy --locked --all-targets -- -D warnings

hnswtoolbox.go

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -265,19 +265,7 @@ func BuildIndex(request BuildRequest) (*BuildResponse, error) {
265265
return nil, errors.New("OutputPath is required")
266266
}
267267

268-
payload := buildPayload{
269-
InputPath: request.InputPath,
270-
OutputPath: request.OutputPath,
271-
InputFormat: request.InputFormat,
272-
Metric: request.Metric,
273-
IncludeDeleted: request.IncludeDeleted,
274-
M: request.M,
275-
M0: request.M0,
276-
EfConstruction: request.EfConstruction,
277-
BatchSize: request.BatchSize,
278-
Capacity: request.Capacity,
279-
Seed: request.Seed,
280-
}
268+
payload := buildPayload(request)
281269

282270
rawPayload, err := json.Marshal(payload)
283271
if err != nil {

0 commit comments

Comments
 (0)