-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (55 loc) · 1.57 KB
/
Makefile
File metadata and controls
68 lines (55 loc) · 1.57 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
.PHONY: test build examples install clean fmt vet lint
# Run tests
test:
go test -v -cover ./...
# Run tests with coverage
test-coverage:
go test -v -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
# Run short tests only
test-short:
go test -v -short ./...
# Build examples
build:
go build -o bin/example examples/main.go
# Run examples
examples:
go run examples/main.go
# Install dependencies
install:
go mod download
go mod tidy
# Format code
fmt:
go fmt ./...
# Run go vet
vet:
go vet ./...
# Run linter (requires golangci-lint)
lint:
golangci-lint run
# Clean build artifacts
clean:
rm -rf bin/
rm -f coverage.out coverage.html
# Run all checks
check: fmt vet test
# Build for multiple platforms
build-all:
GOOS=linux GOARCH=amd64 go build -o bin/example-linux-amd64 examples/main.go
GOOS=darwin GOARCH=amd64 go build -o bin/example-darwin-amd64 examples/main.go
GOOS=windows GOARCH=amd64 go build -o bin/example-windows-amd64.exe examples/main.go
help:
@echo "Available targets:"
@echo " test - Run tests"
@echo " test-coverage - Run tests with coverage report"
@echo " test-short - Run short tests only"
@echo " build - Build examples"
@echo " examples - Run examples"
@echo " install - Install dependencies"
@echo " fmt - Format code"
@echo " vet - Run go vet"
@echo " lint - Run golangci-lint"
@echo " clean - Clean build artifacts"
@echo " check - Run all checks (fmt, vet, test)"
@echo " build-all - Build for multiple platforms"