Skip to content

Commit 05eab5c

Browse files
authored
Merge pull request #134 from essentialkaos/develop
Version 3.2.3
2 parents 157525c + 27f5d0d commit 05eab5c

File tree

10 files changed

+165
-92
lines changed

10 files changed

+165
-92
lines changed

.github/dependabot.yml

+6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ updates:
1414
- "andyone"
1515
reviewers:
1616
- "andyone"
17+
groups:
18+
all:
19+
applies-to: version-updates
20+
update-types:
21+
- "minor"
22+
- "patch"
1723

1824
- package-ecosystem: "github-actions"
1925
directory: "/"

.github/images/card.svg

+1
Loading

.github/images/license.svg

+1
Loading

.github/images/usage.svg

+82
Loading

Makefile

+39-24
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,40 @@
11
################################################################################
22

3-
# This Makefile generated by GoMakeGen 2.2.0 using next command:
3+
# This Makefile generated by GoMakeGen 3.0.2 using next command:
44
# gomakegen --mod .
55
#
66
# More info: https://kaos.sh/gomakegen
77

88
################################################################################
99

10-
export GO111MODULE=on
11-
1210
ifdef VERBOSE ## Print verbose information (Flag)
1311
VERBOSE_FLAG = -v
1412
endif
1513

14+
COMPAT ?= 1.19
1615
MAKEDIR = $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
1716
GITREV ?= $(shell test -s $(MAKEDIR)/.git && git rev-parse --short HEAD)
1817

1918
################################################################################
2019

2120
.DEFAULT_GOAL := help
22-
.PHONY = fmt vet all clean deps update init vendor mod-init mod-update mod-download mod-vendor help
21+
.PHONY = fmt vet all install uninstall clean deps update init vendor mod-init mod-update mod-download mod-vendor help
2322

2423
################################################################################
2524

2625
all: redis-latency-monitor ## Build all binaries
2726

2827
redis-latency-monitor:
29-
go build $(VERBOSE_FLAG) -ldflags="-X main.gitrev=$(GITREV)" redis-latency-monitor.go
28+
@echo "Building redis-latency-monitor…"
29+
@go build $(VERBOSE_FLAG) -ldflags="-X main.gitrev=$(GITREV)" redis-latency-monitor.go
3030

3131
install: ## Install all binaries
32-
cp redis-latency-monitor /usr/bin/redis-latency-monitor
32+
@echo "Installing binaries…"
33+
@cp redis-latency-monitor /usr/bin/redis-latency-monitor
3334

3435
uninstall: ## Uninstall all binaries
35-
rm -f /usr/bin/redis-latency-monitor
36+
@echo "Removing installed binaries…"
37+
@rm -f /usr/bin/redis-latency-monitor
3638

3739
init: mod-init ## Initialize new module
3840

@@ -43,57 +45,70 @@ update: mod-update ## Update dependencies to the latest versions
4345
vendor: mod-vendor ## Make vendored copy of dependencies
4446

4547
mod-init:
48+
@echo "[1/2] Modules initialization…"
4649
ifdef MODULE_PATH ## Module path for initialization (String)
47-
go mod init $(MODULE_PATH)
50+
@go mod init $(MODULE_PATH)
4851
else
49-
go mod init
52+
@go mod init
5053
endif
5154

55+
@echo "[2/2] Dependencies cleanup…"
5256
ifdef COMPAT ## Compatible Go version (String)
53-
go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT)
57+
@go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT) -go=$(COMPAT)
5458
else
55-
go mod tidy $(VERBOSE_FLAG)
59+
@go mod tidy $(VERBOSE_FLAG)
5660
endif
5761

5862
mod-update:
63+
@echo "[1/4] Updating dependencies…"
5964
ifdef UPDATE_ALL ## Update all dependencies (Flag)
60-
go get -u $(VERBOSE_FLAG) all
65+
@go get -u $(VERBOSE_FLAG) all
6166
else
62-
go get -u $(VERBOSE_FLAG) ./...
67+
@go get -u $(VERBOSE_FLAG) ./...
6368
endif
6469

70+
@echo "[2/4] Stripping toolchain info…"
71+
@grep -q 'toolchain ' go.mod && go mod edit -toolchain=none || :
72+
73+
@echo "[3/4] Dependencies cleanup…"
6574
ifdef COMPAT
66-
go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT)
75+
@go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT)
6776
else
68-
go mod tidy $(VERBOSE_FLAG)
77+
@go mod tidy $(VERBOSE_FLAG)
6978
endif
7079

71-
test -d vendor && rm -rf vendor && go mod vendor $(VERBOSE_FLAG) || :
80+
@echo "[4/4] Updating vendored dependencies…"
81+
@test -d vendor && rm -rf vendor && go mod vendor $(VERBOSE_FLAG) || :
7282

7383
mod-download:
74-
go mod download
84+
@echo "Downloading dependencies…"
85+
@go mod download
7586

7687
mod-vendor:
77-
rm -rf vendor && go mod vendor $(VERBOSE_FLAG)
88+
@echo "Vendoring dependencies…"
89+
@rm -rf vendor && go mod vendor $(VERBOSE_FLAG) || :
7890

7991
fmt: ## Format source code with gofmt
80-
find . -name "*.go" -exec gofmt -s -w {} \;
92+
@echo "Formatting sources…"
93+
@find . -name "*.go" -exec gofmt -s -w {} \;
8194

8295
vet: ## Runs 'go vet' over sources
83-
go vet -composites=false -printfuncs=LPrintf,TLPrintf,TPrintf,log.Debug,log.Info,log.Warn,log.Error,log.Critical,log.Print ./...
96+
@echo "Running 'go vet' over sources…"
97+
@go vet -composites=false -printfuncs=LPrintf,TLPrintf,TPrintf,log.Debug,log.Info,log.Warn,log.Error,log.Critical,log.Print ./...
8498

8599
clean: ## Remove generated files
86-
rm -f redis-latency-monitor
100+
@echo "Removing built binaries…"
101+
@rm -f redis-latency-monitor
87102

88103
help: ## Show this info
89104
@echo -e '\n\033[1mTargets:\033[0m\n'
90105
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
91-
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[33m%-23s\033[0m %s\n", $$1, $$2}'
106+
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[33m%-9s\033[0m %s\n", $$1, $$2}'
92107
@echo -e '\n\033[1mVariables:\033[0m\n'
93108
@grep -E '^ifdef [A-Z_]+ .*?## .*$$' $(abspath $(lastword $(MAKEFILE_LIST))) \
94109
| sed 's/ifdef //' \
95-
| awk 'BEGIN {FS = " .*?## "}; {printf " \033[32m%-14s\033[0m %s\n", $$1, $$2}'
110+
| awk 'BEGIN {FS = " .*?## "}; {printf " \033[32m%-11s\033[0m %s\n", $$1, $$2}'
96111
@echo -e ''
97-
@echo -e '\033[90mGenerated by GoMakeGen 2.2.0\033[0m\n'
112+
@echo -e '\033[90mGenerated by GoMakeGen 3.0.2\033[0m\n'
98113

99114
################################################################################

0 commit comments

Comments
 (0)