mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-27 14:11:04 +02:00
build: prep for Go 1.22 by using GOEXPERIMENT=loopvar for tests
In this commit, [we prep for some upcoming changes in Go](https://go.dev/blog/loopvar-preview) by running our tests with `GOEXPERIMENT=loopvar`. This changes the loop semantics to fix a common bug where a scoping issue causes a variable to be re-used, which can cause unintended bugs down the line. If everything passes with this flag on, then we can keep it on, and also rest a bit easier knowing that the compiler will fix a class of bugs that would previously pop up for us.
This commit is contained in:
2
Makefile
2
Makefile
@@ -23,7 +23,7 @@ COMMIT := $(shell git describe --tags --dirty)
|
||||
|
||||
GOBUILD := go build -v
|
||||
GOINSTALL := go install -v
|
||||
GOTEST := go test
|
||||
GOTEST := GOEXPERIMENT=loopvar go test
|
||||
|
||||
GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*" -not -name "*pb.go" -not -name "*pb.gw.go" -not -name "*.pb.json.go")
|
||||
|
||||
|
Reference in New Issue
Block a user