diff --git a/Makefile b/Makefile index 5ea087892..cb5d43e02 100644 --- a/Makefile +++ b/Makefile @@ -23,11 +23,12 @@ ANDROID_BUILD := $(ANDROID_BUILD_DIR)/Lndmobile.aar COMMIT := $(shell git describe --tags --dirty) -GO_VERSION := $(shell go version | sed -nre 's/^[^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p') -GO_VERSION_MINOR := $(shell echo $(GO_VERSION) | cut -d. -f2) +# Determine the minor version of the active Go installation. +ACTIVE_GO_VERSION := $(shell go version | sed -nre 's/^[^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p') +ACTIVE_GO_VERSION_MINOR := $(shell echo $(ACTIVE_GO_VERSION) | cut -d. -f2) LOOPVARFIX := -ifeq ($(shell expr $(GO_VERSION_MINOR) \>= 21), 1) +ifeq ($(shell expr $(ACTIVE_GO_VERSION_MINOR) \>= 21), 1) LOOPVARFIX := GOEXPERIMENT=loopvar endif