Skip to content

Commit 576da75

Browse files
committedFeb 28, 2025
multi: remove unneeded env variables
With Go 1.23 we don't need to set any of these variables anymore, as they're the default values now.
1 parent 70ac201 commit 576da75

File tree

4 files changed

+8
-14
lines changed

4 files changed

+8
-14
lines changed
 

‎.github/workflows/release.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ jobs:
121121
```
122122
tar -xvzf vendor.tar.gz
123123
tar -xvzf lnd-source-${{ env.RELEASE_VERSION }}.tar.gz
124-
GO111MODULE=on go install -v -mod=vendor -ldflags "-X github.com/lightningnetwork/lnd/build.Commit=${{ env.RELEASE_VERSION }}" ./cmd/lnd
125-
GO111MODULE=on go install -v -mod=vendor -ldflags "-X github.com/lightningnetwork/lnd/build.Commit=${{ env.RELEASE_VERSION }}" ./cmd/lncli
124+
go install -v -mod=vendor -ldflags "-X github.com/lightningnetwork/lnd/build.Commit=${{ env.RELEASE_VERSION }}" ./cmd/lnd
125+
go install -v -mod=vendor -ldflags "-X github.com/lightningnetwork/lnd/build.Commit=${{ env.RELEASE_VERSION }}" ./cmd/lncli
126126
```
127127
128128
The `-mod=vendor` flag tells the `go build` command that it doesn't need to fetch the dependencies, and instead, they're all enclosed in the local vendor directory.

‎Makefile

+3-8
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,14 @@ COMMIT := $(shell git describe --tags --dirty)
2525
ACTIVE_GO_VERSION := $(shell $(GOCC) version | sed -nre 's/^[^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p')
2626
ACTIVE_GO_VERSION_MINOR := $(shell echo $(ACTIVE_GO_VERSION) | cut -d. -f2)
2727

28-
LOOPVARFIX :=
29-
ifeq ($(shell expr $(ACTIVE_GO_VERSION_MINOR) \>= 21), 1)
30-
LOOPVARFIX := GOEXPERIMENT=loopvar
31-
endif
32-
3328
# GO_VERSION is the Go version used for the release build, docker files, and
3429
# GitHub Actions. This is the reference version for the project. All other Go
3530
# versions are checked against this version.
3631
GO_VERSION = 1.23.6
3732

38-
GOBUILD := $(LOOPVARFIX) $(GOCC) build -v
39-
GOINSTALL := $(LOOPVARFIX) $(GOCC) install -v
40-
GOTEST := $(LOOPVARFIX) $(GOCC) test
33+
GOBUILD := $(GOCC) build -v
34+
GOINSTALL := $(GOCC) install -v
35+
GOTEST := $(GOCC) test
4136

4237
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")
4338

‎make/builder.Dockerfile

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ MAINTAINER Olaoluwa Osuntokun <laolu@lightning.engineering>
77
# Golang build related environment variables that are static and used for all
88
# architectures/OSes.
99
ENV GODEBUG netdns=cgo
10-
ENV GO111MODULE=auto
1110
ENV CGO_ENABLED=0
1211

1312
# Set up cache directories. Those will be mounted from the host system to speed

‎scripts/release.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function check_tag_correct() {
9898
fi
9999

100100
# Build lnd to extract version.
101-
env GOEXPERIMENT=loopvar go build ${PKG}/cmd/lnd
101+
go build ${PKG}/cmd/lnd
102102

103103
# Extract version command output.
104104
lnd_version_output=$(./lnd --version)
@@ -189,8 +189,8 @@ required Go version ($goversion)."
189189
pushd "${dir}"
190190

191191
green " - Building: ${os} ${arch} ${arm} with build tags '${buildtags}'"
192-
env GOEXPERIMENT=loopvar CGO_ENABLED=0 GOOS=$os GOARCH=$arch GOARM=$arm go build -v -trimpath -ldflags="${ldflags}" -tags="${buildtags}" ${PKG}/cmd/lnd
193-
env GOEXPERIMENT=loopvar CGO_ENABLED=0 GOOS=$os GOARCH=$arch GOARM=$arm go build -v -trimpath -ldflags="${ldflags}" -tags="${buildtags}" ${PKG}/cmd/lncli
192+
env CGO_ENABLED=0 GOOS=$os GOARCH=$arch GOARM=$arm go build -v -trimpath -ldflags="${ldflags}" -tags="${buildtags}" ${PKG}/cmd/lnd
193+
env CGO_ENABLED=0 GOOS=$os GOARCH=$arch GOARM=$arm go build -v -trimpath -ldflags="${ldflags}" -tags="${buildtags}" ${PKG}/cmd/lncli
194194
popd
195195

196196
# Add the hashes for the individual binaries as well for easy verification

0 commit comments

Comments
 (0)
Please sign in to comment.