-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (25 loc) · 931 Bytes
/
Copy pathMakefile
File metadata and controls
31 lines (25 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
.PHONY: help
help: ## Show this help message
@echo 'Usage: make [target]'
@echo ''
@echo 'Targets:'
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-15s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
.PHONY: deps
deps: ## Get dependencies
go get -v -t -d ./...
.PHONY: build
build: ## Build the package
go build -v .
.PHONY: test
test: ## ## Run tests with race detection and coverage
go test -race -count=1 -coverprofile=profile.cov -covermode=atomic ./...
cd internal/myapp && go test -count=1 ./...
.PHONY: coverage
coverage: test-race ## Generate coverage report (requires test-race)
go tool cover -html=profile.cov -o coverage.html
@echo "Coverage report generated at coverage.html"
.PHONY: lint
lint: ./bin/golangci-lint ## Run linter (installs if needed)
./bin/golangci-lint run .
./bin/golangci-lint:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v2.3.0