2021-09-23 16:31:21 +03:00
|
|
|
PACKAGE_DIRS := $(shell find . -mindepth 2 -type f -name 'go.mod' -exec dirname {} \; | sort)
|
|
|
|
|
2021-03-23 11:28:25 +03:00
|
|
|
test: testdeps
|
2016-03-16 17:57:24 +03:00
|
|
|
go test ./...
|
|
|
|
go test ./... -short -race
|
2019-05-31 13:16:10 +03:00
|
|
|
go test ./... -run=NONE -bench=. -benchmem
|
2018-03-07 13:20:26 +03:00
|
|
|
env GOOS=linux GOARCH=386 go test ./...
|
2020-09-17 17:01:29 +03:00
|
|
|
go vet
|
2022-08-08 08:40:51 +03:00
|
|
|
cd internal/customvet && go build .
|
|
|
|
go vet -vettool ./internal/customvet/customvet
|
2015-01-24 15:12:48 +03:00
|
|
|
|
2016-03-12 13:25:59 +03:00
|
|
|
testdeps: testdata/redis/src/redis-server
|
2015-01-24 15:12:48 +03:00
|
|
|
|
2016-03-12 13:38:52 +03:00
|
|
|
bench: testdeps
|
|
|
|
go test ./... -test.run=NONE -test.bench=. -test.benchmem
|
|
|
|
|
|
|
|
.PHONY: all test testdeps bench
|
2015-01-24 15:12:48 +03:00
|
|
|
|
2016-03-12 13:25:59 +03:00
|
|
|
testdata/redis:
|
2015-01-24 15:12:48 +03:00
|
|
|
mkdir -p $@
|
2022-12-16 12:22:50 +03:00
|
|
|
wget -qO- https://download.redis.io/releases/redis-7.0.6.tar.gz | tar xvz --strip-components=1 -C $@
|
2015-01-24 15:12:48 +03:00
|
|
|
|
2016-03-12 13:25:59 +03:00
|
|
|
testdata/redis/src/redis-server: testdata/redis
|
2015-01-24 15:12:48 +03:00
|
|
|
cd $< && make all
|
2020-11-21 11:18:39 +03:00
|
|
|
|
2021-09-08 16:00:52 +03:00
|
|
|
fmt:
|
|
|
|
gofmt -w -s ./
|
|
|
|
goimports -w -local github.com/go-redis/redis ./
|
2021-09-23 16:31:21 +03:00
|
|
|
|
|
|
|
go_mod_tidy:
|
|
|
|
set -e; for dir in $(PACKAGE_DIRS); do \
|
|
|
|
echo "go mod tidy in $${dir}"; \
|
|
|
|
(cd "$${dir}" && \
|
2022-06-04 15:15:43 +03:00
|
|
|
go get -u ./... && \
|
|
|
|
go mod tidy -compat=1.17); \
|
2021-09-23 16:31:21 +03:00
|
|
|
done
|