Skip to content

Commit df80f2c

Browse files
BE-730 | golangci-lint to use toolchain of the current Go version specified in go.mod (#650)
Older versions of golangci-lint has some memory leaks when running with newer Go versions leading consuming all available RAM and crashing. This PR forces to use toolchain of the current Go version specified in go.mod.
1 parent 63ec80f commit df80f2c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export OSTYPE := $(shell uname -s)
99
VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//')
1010
COMMIT := $(shell git log -1 --format='%H')
1111
GO_VERSION := $(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f 2)
12+
GOTOOLCHAIN := go$(GO_VERSION)
1213
PACKAGES_UNIT=$(shell go list ./...)
1314
DOCKER := $(shell which docker)
1415
BUILDDIR ?= $(CURDIR)/build
@@ -58,7 +59,7 @@ all-start: osmosis-start run
5859

5960
lint:
6061
@echo "--> Running linter"
61-
golangci-lint run --timeout=10m
62+
GOTOOLCHAIN=$(GOTOOLCHAIN) golangci-lint run --timeout=10m
6263

6364
test-unit:
6465
@VERSION=$(VERSION) go test -mod=readonly $(PACKAGES_UNIT)

0 commit comments

Comments
 (0)