Skip to content

Commit aa60113

Browse files
fix: errcheck lint in progress_test.go, add make lint/check targets
- Fix unchecked io.Copy return in progress_test.go (errcheck) - Add 'make lint' target (auto-installs golangci-lint if missing) - Add 'make check' target (runs tests + lint together) - Update 'make test' to include -race -count=1 -timeout 120s
1 parent 2ff2530 commit aa60113

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

Makefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
.PHONY: all build clean generate test test-integration test-validation
2+
.PHONY: all build clean generate test test-integration test-validation lint check
33

44
all: build
55

@@ -15,7 +15,14 @@ generate:
1515
-c internal/ebpf/c/tcpretrans.bpf.c -o internal/ebpf/bpf/tcpretrans.o
1616

1717
test:
18-
go test ./...
18+
go test -race -count=1 -timeout 120s ./...
19+
20+
lint:
21+
@which golangci-lint > /dev/null 2>&1 || { echo "Installing golangci-lint..."; go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest; }
22+
golangci-lint run --timeout=5m
23+
24+
check: test lint
25+
@echo "All checks passed."
1926

2027
test-integration:
2128
bash tests/integration/docker_test.sh

internal/output/progress_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func captureStderr(fn func()) string {
1919
os.Stderr = old
2020

2121
var buf bytes.Buffer
22-
io.Copy(&buf, r)
22+
_, _ = io.Copy(&buf, r)
2323
return buf.String()
2424
}
2525

0 commit comments

Comments
 (0)