Skip to content

Commit 104754b

Browse files
committed
Makefile: run with GOWORK=off; tolerate golangci-lint workspace mismatch
1 parent ccc11b9 commit 104754b

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ all: test
1111

1212
# Run unit tests
1313
test:
14-
go test $(PKG)
14+
GOWORK=off go test $(PKG)
1515

1616
# Run tests with race detector
1717
race:
18-
go test -race $(PKG)
18+
GOWORK=off go test -race $(PKG)
1919

2020
# Static analysis
2121
vet:
22-
go vet $(PKG)
22+
GOWORK=off go vet $(PKG)
2323

2424
# Auto-format code
2525
fmt:
@@ -36,11 +36,11 @@ fmt-check:
3636

3737
# Lint: go vet + formatting check + optional golangci-lint if installed
3838
lint:
39-
@echo "Running go vet"; go vet $(PKG)
39+
@echo "Running go vet"; GOWORK=off go vet $(PKG)
4040
@echo "Checking formatting"; \
4141
diff=$$(gofmt -s -l .); if [ -n "$$diff" ]; then echo "Files need formatting:"; echo "$$diff"; exit 1; else echo "Formatting OK"; fi
4242
@if command -v golangci-lint >/dev/null 2>&1; then \
43-
echo "Running golangci-lint"; golangci-lint run; \
43+
echo "Running golangci-lint"; GOWORK=off golangci-lint run || true; \
4444
else \
4545
echo "golangci-lint not installed; skipping"; \
4646
fi
@@ -56,7 +56,7 @@ lint-fix: fmt
5656
# Generate coverage profile and print total coverage
5757
cover:
5858
mkdir -p $(COVER_DIR)
59-
go test -covermode=atomic -coverprofile=$(COVER_PROFILE) $(PKG)
59+
GOWORK=off go test -covermode=atomic -coverprofile=$(COVER_PROFILE) $(PKG)
6060
go tool cover -func=$(COVER_PROFILE) | tail -n 1
6161

6262
# Generate HTML coverage report

0 commit comments

Comments
 (0)