From 834371c9955e854712f4cca554cfa4213055d5ba Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Wed, 6 Mar 2024 13:38:51 +0100 Subject: [PATCH] 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). --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c4829bf1b..fd8f10ad7 100644 --- a/Makefile +++ b/Makefile @@ -63,7 +63,11 @@ ifneq ($(workers),) LINT_WORKERS = --concurrency=$(workers) endif -DOCKER_TOOLS = docker run --rm -v $$(pwd):/build lnd-tools +DOCKER_TOOLS = docker run \ + --rm \ + -v $(shell bash -c "go env GOCACHE || (mkdir -p /tmp/go-cache; echo /tmp/go-cache)"):/tmp/build/.cache \ + -v $(shell bash -c "go env GOMODCACHE || (mkdir -p /tmp/go-modcache; echo /tmp/go-modcache)"):/tmp/build/.modcache \ + -v $$(pwd):/build lnd-tools GREEN := "\\033[0;32m" NC := "\\033[0m"