...
1.PHONY: default build test benchmark fmt vet
2
3default: build
4
5build:
6 go build ./...
7
8test:
9 go test sigs.k8s.io/json/...
10
11benchmark:
12 go test sigs.k8s.io/json -bench . -benchmem
13
14fmt:
15 go mod tidy
16 gofmt -s -w *.go
17
18vet:
19 go vet sigs.k8s.io/json
20
21 @echo "checking for external dependencies"
22 @deps=$$(go mod graph); \
23 if [ -n "$${deps}" ]; then \
24 echo "only stdlib dependencies allowed, found:"; \
25 echo "$${deps}"; \
26 exit 1; \
27 fi
28
29 @echo "checking for unsafe use"
30 @unsafe=$$(go list -f '{{.ImportPath}} depends on {{.Imports}}' sigs.k8s.io/json/... | grep unsafe || true); \
31 if [ -n "$${unsafe}" ]; then \
32 echo "no dependencies on unsafe allowed, found:"; \
33 echo "$${unsafe}"; \
34 exit 1; \
35 fi
View as plain text