Skip to content

Commit 1760d67

Browse files
authored
Prepare for go1.18 modules and generics (#26)
1 parent 8c7b118 commit 1760d67

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ ifeq ($(DEVGO_PATH),)
4747
DEVGO_PATH := $(shell GO111MODULE=on $(GO) list ${modVendor} -f '{{.Dir}}' -m github.com/bool64/dev)
4848
ifeq ($(DEVGO_PATH),)
4949
$(info Module github.com/bool64/dev not found, downloading.)
50-
DEVGO_PATH := $(shell export GO111MODULE=on && $(GO) mod tidy && $(GO) list -f '{{.Dir}}' -m github.com/bool64/dev)
50+
DEVGO_PATH := $(shell export GO111MODULE=on && $(GO) get github.com/bool64/dev && $(GO) list -f '{{.Dir}}' -m github.com/bool64/dev)
5151
endif
5252
endif
5353

makefiles/base.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ifeq ($(DEVGO_PATH),)
2323
DEVGO_PATH := $(shell GO111MODULE=on $(GO) list ${modVendor} -f '{{.Dir}}' -m github.com/bool64/dev)
2424
ifeq ($(DEVGO_PATH),)
2525
$(info Module github.com/bool64/dev not found, downloading.)
26-
DEVGO_PATH := $(shell export GO111MODULE=on && $(GO) mod tidy && $(GO) list -f '{{.Dir}}' -m github.com/bool64/dev)
26+
DEVGO_PATH := $(shell export GO111MODULE=on && $(GO) get github.com/bool64/dev && $(GO) list -f '{{.Dir}}' -m github.com/bool64/dev)
2727
endif
2828
endif
2929

makefiles/test-unit.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ UNIT_TEST_COUNT ?= 2
44
## Run unit tests
55
test-unit:
66
@echo "Running unit tests."
7-
@CGO_ENABLED=1 $(GO) test -short -gcflags=-l -coverprofile=unit.coverprofile -covermode=atomic -race ./...
7+
@CGO_ENABLED=1 $(GO) test -short -coverprofile=unit.coverprofile -covermode=atomic -race ./...
88

99
## Run unit tests multiple times
1010
test-unit-multi:
1111
@echo "Running unit tests ${UNIT_TEST_COUNT} times."
12-
@CGO_ENABLED=1 $(GO) test -short -gcflags=-l -coverprofile=unit.coverprofile -count $(UNIT_TEST_COUNT) -covermode=atomic -race ./...
12+
@CGO_ENABLED=1 $(GO) test -short -coverprofile=unit.coverprofile -count $(UNIT_TEST_COUNT) -covermode=atomic -race ./...
1313

1414
.PHONY: test-unit test-unit-multi

scripts/fix.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ SOURCES_TO_LINT=$(find . -name '*.go' -not -path "./vendor/*")
1212
# gogroup enforces import grouping: https://github.com/vasi-stripe/gogroup
1313
if ! command -v gogroup > /dev/null ; then \
1414
echo "Installing gogroup..."; \
15-
bash -c "cd /tmp;GO111MODULE=on $GO get github.com/vasi-stripe/gogroup/cmd/[email protected]";
15+
$GO install github.com/vasi-stripe/gogroup/cmd/[email protected];
1616
fi
1717

1818
gogroup -order std,other -rewrite ${SOURCES_TO_LINT}
@@ -21,8 +21,8 @@ gogroup -order std,other -rewrite ${SOURCES_TO_LINT}
2121
# gofumpt is a drop-in replacement for gofmt with stricter formatting: https://github.com/mvdan/gofumpt
2222
if ! command -v gofumpt > /dev/null ; then \
2323
echo "Installing gofumpt..."; \
24-
bash -c "cd /tmp;GO111MODULE=on $GO get mvdan.cc/gofumpt@v0.0.0-20200802201014-ab5a8192947d";
24+
$GO install mvdan.cc/gofumpt@4d8e76d698e7e061266253df920ef5b28d8f8f13;
2525
fi
2626

2727
# simplify code
28-
gofumpt -s -w ${SOURCES_TO_LINT} &>/dev/null
28+
gofumpt -w ${SOURCES_TO_LINT}

0 commit comments

Comments
 (0)