-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (46 loc) · 1.32 KB
/
Makefile
File metadata and controls
64 lines (46 loc) · 1.32 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
.PHONY: default dev build test test-coverage race fmt lint vet deps deps-upgrade check-security bench clean quality install-tools verify-examples
default: check
build:
go build ./...
@echo "✅ Library validation complete - no build errors"
test:
go test -v ./pkg... --timeout 30s
test-coverage:
go test -v -coverprofile=coverage.out ./pkg...
go tool cover -html=coverage.out -o coverage.html
race:
go test -v -race ./pkg...
fmt:
go fmt ./...
lint:
golangci-lint run
vet:
go vet ./...
deps:
go mod download
go mod tidy
check-security:
gosec ./...
bench:
go test -bench=. -benchmem ./...
clean:
rm -rf bin/
rm -f coverage.out coverage.html
check: fmt vet lint test race check-security verify-examples
install-tools:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
go install github.com/securego/gosec/v2/cmd/gosec@latest
go install github.com/goreleaser/goreleaser@latest
release:
goreleaser release --clean
release-check:
goreleaser check
verify-examples:
@echo "🔍 Verifying all examples build and run successfully..."
@find examples -name "*.go" -type f | while read file; do \
dir=$$(dirname "$$file"); \
name=$$(basename "$$dir"); \
cd "$$dir" && go build -o /tmp/test_example_$$name || exit 1; \
cd - > /dev/null; \
done
@echo "🎉 All examples verified successfully!"