Skip to content

Commit 834371c

Browse files
committed
make: use Golang build and module cache for linter
This commit gives the linter container access to the local machine's build and module cache, drastically decreasing the run time of subsequent linter runs (no difference on first run with this change).
1 parent f617612 commit 834371c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ ifneq ($(workers),)
6363
LINT_WORKERS = --concurrency=$(workers)
6464
endif
6565

66-
DOCKER_TOOLS = docker run --rm -v $$(pwd):/build lnd-tools
66+
DOCKER_TOOLS = docker run \
67+
--rm \
68+
-v $(shell bash -c "go env GOCACHE || (mkdir -p /tmp/go-cache; echo /tmp/go-cache)"):/tmp/build/.cache \
69+
-v $(shell bash -c "go env GOMODCACHE || (mkdir -p /tmp/go-modcache; echo /tmp/go-modcache)"):/tmp/build/.modcache \
70+
-v $$(pwd):/build lnd-tools
6771

6872
GREEN := "\\033[0;32m"
6973
NC := "\\033[0m"

0 commit comments

Comments
 (0)