-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (26 loc) · 772 Bytes
/
Makefile
File metadata and controls
35 lines (26 loc) · 772 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
32
33
34
35
SHELL:=/bin/bash
YELLOW := \e[0;33m
RESET := \e[0;0m
GOVER := $(shell go env GOVERSION)
GOMINOR := $(shell bash -c "cut -f1 -d' ' <<< \"$(GOVER)\" | cut -f2 -d.")
define execute-if-go-124
@{ \
if [[ 24 -le $(GOMINOR) ]]; then \
$1; \
else \
echo -e "$(YELLOW)Skipping task as you're running Go v1.$(GOMINOR).x which is < Go 1.24, which this module requires$(RESET)"; \
fi \
}
endef
lint:
$(call execute-if-go-124,$(GOBIN)/golangci-lint run ./...)
lint-ci:
$(call execute-if-go-124,$(GOBIN)/golangci-lint run ./... --output.text.path=stdout --timeout=5m)
generate:
$(call execute-if-go-124,go generate ./...)
test:
@echo "Skipping tests in experimental module"
tidy:
$(call execute-if-go-124,go mod tidy)
tidy-ci:
$(call execute-if-go-124,tidied -verbose)