Skip to content

Commit 5ee81e1

Browse files
authored
Merge pull request #9512 from Roasbeef/go-1-23
multi: update build system to Go 1.23
2 parents 01819f0 + fa10991 commit 5ee81e1

File tree

21 files changed

+384
-363
lines changed

21 files changed

+384
-363
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ env:
3434

3535
# If you change this please also update GO_VERSION in Makefile (then run
3636
# `make lint` to see where else it needs to be updated as well).
37-
GO_VERSION: 1.22.11
37+
GO_VERSION: 1.23.6
3838

3939
jobs:
4040
########################

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ defaults:
1212
env:
1313
# If you change this please also update GO_VERSION in Makefile (then run
1414
# `make lint` to see where else it needs to be updated as well).
15-
GO_VERSION: 1.22.11
15+
GO_VERSION: 1.23.6
1616

1717
jobs:
1818
main:

.golangci.yml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
run:
22
# If you change this please also update GO_VERSION in Makefile (then run
33
# `make lint` to see where else it needs to be updated as well).
4-
go: "1.22.11"
4+
go: "1.23.6"
55

66
# Abort after 10 minutes.
77
timeout: 10m
@@ -38,10 +38,6 @@ linters-settings:
3838
# Check for incorrect fmt.Errorf error wrapping.
3939
errorf: true
4040

41-
govet:
42-
# Don't report about shadowed variables
43-
check-shadowing: false
44-
4541
gofmt:
4642
# simplify code: gofmt with `-s` option, true by default
4743
simplify: true
@@ -60,6 +56,7 @@ linters-settings:
6056
- G402 # Look for bad TLS connection settings.
6157
- G306 # Poor file permissions used when writing to a new file.
6258
- G601 # Implicit memory aliasing in for loop.
59+
- G115 # Integer overflow in conversion.
6360

6461
staticcheck:
6562
checks: ["-SA1019"]
@@ -151,9 +148,7 @@ linters:
151148
- gofumpt
152149

153150
# Disable whitespace linter as it has conflict rules against our
154-
# contribution guidelines. See https://github.com/bombsimon/wsl/issues/109.
155-
#
156-
# TODO(yy): bring it back when the above issue is fixed.
151+
# contribution guidelines.
157152
- wsl
158153

159154
# Allow using default empty values.
@@ -182,7 +177,7 @@ linters:
182177
- wrapcheck
183178

184179
# Allow dynamic errors.
185-
- goerr113
180+
- err113
186181

187182
# We use ErrXXX instead.
188183
- errname
@@ -197,7 +192,7 @@ linters:
197192

198193
# The linter is too aggressive and doesn't add much value since reviewers
199194
# will also catch magic numbers that make sense to extract.
200-
- gomnd
195+
- mnd
201196

202197
# Some of the tests cannot be parallelized. On the other hand, we don't
203198
# gain much performance with this check so we disable it for now until
@@ -218,16 +213,7 @@ linters:
218213
- goconst
219214

220215
# Deprecated linters that have been replaced by newer ones.
221-
- deadcode
222-
- exhaustivestruct
223-
- ifshort
224-
- golint
225-
- interfacer
226-
- varcheck
227-
- nosnakecase
228-
- scopelint
229-
- structcheck
230-
- maligned
216+
- tenv
231217

232218
issues:
233219
# Only show newly introduced problems.

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# If you change this please also update GO_VERSION in Makefile (then run
22
# `make lint` to see where else it needs to be updated as well).
3-
FROM golang:1.22.11-alpine as builder
3+
FROM golang:1.23.6-alpine as builder
44

55
# Force Go to use the cgo based DNS resolver. This is required to ensure DNS
66
# queries required to connect to linked containers succeed.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ endif
3535
# GO_VERSION is the Go version used for the release build, docker files, and
3636
# GitHub Actions. This is the reference version for the project. All other Go
3737
# versions are checked against this version.
38-
GO_VERSION = 1.22.11
38+
GO_VERSION = 1.23.6
3939

4040
GOBUILD := $(LOOPVARFIX) go build -v
4141
GOINSTALL := $(LOOPVARFIX) go install -v

autopilot/prefattach_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ func newMemChannelGraph() *memChannelGraph {
578578
// error, then execution should be terminated.
579579
//
580580
// NOTE: Part of the autopilot.ChannelGraph interface.
581-
func (m memChannelGraph) ForEachNode(cb func(Node) error) error {
581+
func (m *memChannelGraph) ForEachNode(cb func(Node) error) error {
582582
for _, node := range m.graph {
583583
if err := cb(node); err != nil {
584584
return err

dev.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# If you change this please also update GO_VERSION in Makefile (then run
22
# `make lint` to see where else it needs to be updated as well).
3-
FROM golang:1.22.11-alpine as builder
3+
FROM golang:1.23.6-alpine as builder
44

55
LABEL maintainer="Olaoluwa Osuntokun <laolu@lightning.engineering>"
66

docker/btcd/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# If you change this please also update GO_VERSION in Makefile (then run
22
# `make lint` to see where else it needs to be updated as well).
3-
FROM golang:1.22.11-alpine as builder
3+
FROM golang:1.23.6-alpine as builder
44

55
LABEL maintainer="Olaoluwa Osuntokun <laolu@lightning.engineering>"
66

docs/INSTALL.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,24 +93,24 @@ following build dependencies are required:
9393

9494
### Installing Go
9595

96-
`lnd` is written in Go, with a minimum version of `1.22.6` (or, in case this
96+
`lnd` is written in Go, with a minimum version of `1.23.6` (or, in case this
9797
document gets out of date, whatever the Go version in the main `go.mod` file
9898
requires). To install, run one of the following commands for your OS:
9999

100100
<details>
101101
<summary>Linux (x86-64)</summary>
102102

103103
```
104-
wget https://dl.google.com/go/go1.22.6.linux-amd64.tar.gz
105-
sha256sum go1.22.6.linux-amd64.tar.gz | awk -F " " '{ print $1 }'
104+
wget https://dl.google.com/go/go1.23.6.linux-amd64.tar.gz
105+
sha256sum go1.23.6.linux-amd64.tar.gz | awk -F " " '{ print $1 }'
106106
```
107107

108108
The final output of the command above should be
109-
`999805bed7d9039ec3da1a53bfbcafc13e367da52aa823cb60b68ba22d44c616`. If it
109+
`9379441ea310de000f33a4dc767bd966e72ab2826270e038e78b2c53c2e7802d`. If it
110110
isn't, then the target REPO HAS BEEN MODIFIED, and you shouldn't install
111111
this version of Go. If it matches, then proceed to install Go:
112112
```
113-
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.22.6.linux-amd64.tar.gz
113+
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.23.6.linux-amd64.tar.gz
114114
export PATH=$PATH:/usr/local/go/bin
115115
```
116116
</details>
@@ -119,16 +119,16 @@ requires). To install, run one of the following commands for your OS:
119119
<summary>Linux (ARMv6)</summary>
120120

121121
```
122-
wget https://dl.google.com/go/go1.22.6.linux-armv6l.tar.gz
123-
sha256sum go1.22.6.linux-armv6l.tar.gz | awk -F " " '{ print $1 }'
122+
wget https://dl.google.com/go/go1.23.6.linux-armv6l.tar.gz
123+
sha256sum go1.23.6.linux-armv6l.tar.gz | awk -F " " '{ print $1 }'
124124
```
125125

126126
The final output of the command above should be
127-
`b566484fe89a54c525dd1a4cbfec903c1f6e8f0b7b3dbaf94c79bc9145391083`. If it
127+
`27a4611010c16b8c4f37ade3aada55bd5781998f02f348b164302fd5eea4eb74`. If it
128128
isn't, then the target REPO HAS BEEN MODIFIED, and you shouldn't install
129129
this version of Go. If it matches, then proceed to install Go:
130130
```
131-
sudo rm -rf /usr/local/go && tar -C /usr/local -xzf go1.22.6.linux-armv6l.tar.gz
131+
sudo rm -rf /usr/local/go && tar -C /usr/local -xzf go1.23.6.linux-armv6l.tar.gz
132132
export PATH=$PATH:/usr/local/go/bin
133133
```
134134

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,6 @@ replace google.golang.org/protobuf => github.com/lightninglabs/protobuf-go-hex-d
210210
// If you change this please also update docs/INSTALL.md and GO_VERSION in
211211
// Makefile (then run `make lint` to see where else it needs to be updated as
212212
// well).
213-
go 1.22.6
213+
go 1.23.6
214214

215215
retract v0.0.2

graph/db/graph.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ func (c *ChannelGraph) ForEachNode(cb func(tx NodeRTx) error) error {
733733
// early.
734734
//
735735
// TODO(roasbeef): add iterator interface to allow for memory efficient graph
736-
// traversal when graph gets mega
736+
// traversal when graph gets mega.
737737
func (c *ChannelGraph) forEachNode(
738738
cb func(kvdb.RTx, *models.LightningNode) error) error {
739739

invoices/sql_migration_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func randomStringRapid(t *rapid.T, length int) string {
4343
}
4444

4545
// randTimeBetween generates a random time between min and max.
46-
func randTimeBetween(min, max time.Time) time.Time {
46+
func randTimeBetween(minTime, maxTime time.Time) time.Time {
4747
var timeZones = []*time.Location{
4848
time.UTC,
4949
time.FixedZone("EST", -5*3600),
@@ -53,16 +53,16 @@ func randTimeBetween(min, max time.Time) time.Time {
5353
}
5454

5555
// Ensure max is after min
56-
if max.Before(min) {
57-
min, max = max, min
56+
if maxTime.Before(minTime) {
57+
minTime, maxTime = maxTime, minTime
5858
}
5959

6060
// Calculate the range in nanoseconds
61-
duration := max.Sub(min)
61+
duration := maxTime.Sub(minTime)
6262
randDuration := time.Duration(rand.Int63n(duration.Nanoseconds()))
6363

6464
// Generate the random time
65-
randomTime := min.Add(randDuration)
65+
randomTime := minTime.Add(randDuration)
6666

6767
// Assign a random time zone
6868
randomTimeZone := timeZones[rand.Intn(len(timeZones))]
@@ -73,10 +73,10 @@ func randTimeBetween(min, max time.Time) time.Time {
7373

7474
// randTime generates a random time between 2009 and 2140.
7575
func randTime() time.Time {
76-
min := time.Date(2009, 1, 3, 0, 0, 0, 0, time.UTC)
77-
max := time.Date(2140, 1, 1, 0, 0, 0, 1000, time.UTC)
76+
minTime := time.Date(2009, 1, 3, 0, 0, 0, 0, time.UTC)
77+
maxTime := time.Date(2140, 1, 1, 0, 0, 0, 1000, time.UTC)
7878

79-
return randTimeBetween(min, max)
79+
return randTimeBetween(minTime, maxTime)
8080
}
8181

8282
func randInvoiceTime(invoice *Invoice) time.Time {

lnrpc/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# If you change this please also update GO_VERSION in Makefile (then run
22
# `make lint` to see where else it needs to be updated as well).
3-
FROM golang:1.22.11-bookworm
3+
FROM golang:1.23.6-bookworm
44

55
RUN apt-get update && apt-get install -y \
66
git \

lnrpc/gen_protos_docker.sh

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,28 @@
33
set -e
44

55
# Directory of the script file, independent of where it's called from.
6-
DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"
6+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
77

88
# golang docker image version used in this script.
9-
GO_IMAGE=docker.io/library/golang:1.22.11-alpine
9+
GO_IMAGE=docker.io/library/golang:1.23.6-alpine
1010

1111
PROTOBUF_VERSION=$(docker run --rm -v $DIR/../:/lnd -w /lnd $GO_IMAGE \
12-
go list -f '{{.Version}}' -m google.golang.org/protobuf)
12+
go list -f '{{.Version}}' -m google.golang.org/protobuf)
1313
GRPC_GATEWAY_VERSION=$(docker run --rm -v $DIR/../:/lnd -w /lnd $GO_IMAGE \
14-
go list -f '{{.Version}}' -m github.com/grpc-ecosystem/grpc-gateway/v2)
14+
go list -f '{{.Version}}' -m github.com/grpc-ecosystem/grpc-gateway/v2)
1515

1616
echo "Building protobuf compiler docker image..."
1717
docker build -t lnd-protobuf-builder \
18-
--build-arg PROTOBUF_VERSION="$PROTOBUF_VERSION" \
19-
--build-arg GRPC_GATEWAY_VERSION="$GRPC_GATEWAY_VERSION" \
20-
.
18+
--build-arg PROTOBUF_VERSION="$PROTOBUF_VERSION" \
19+
--build-arg GRPC_GATEWAY_VERSION="$GRPC_GATEWAY_VERSION" \
20+
.
2121

2222
echo "Compiling and formatting *.proto files..."
2323
docker run \
24-
--rm \
25-
--user "$UID:$(id -g)" \
26-
-e UID=$UID \
27-
-e COMPILE_MOBILE \
28-
-e SUBSERVER_PREFIX \
29-
-v "$DIR/../:/build" \
30-
lnd-protobuf-builder
24+
--rm \
25+
--user "$UID:$(id -g)" \
26+
-e UID=$UID \
27+
-e COMPILE_MOBILE \
28+
-e SUBSERVER_PREFIX \
29+
-v "$DIR/../:/build" \
30+
lnd-protobuf-builder

make/builder.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# If you change this please also update GO_VERSION in Makefile (then run
22
# `make lint` to see where else it needs to be updated as well).
3-
FROM golang:1.22.11-bookworm
3+
FROM golang:1.23.6-bookworm
44

55
MAINTAINER Olaoluwa Osuntokun <laolu@lightning.engineering>
66

tools/.custom-gcl.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: v1.57.0
1+
version: v1.64.5
22
plugins:
33
- module: 'github.com/lightningnetwork/lnd/tools/linters'
44
path: ./linters

tools/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.22.11
1+
FROM golang:1.23.6
22

33
RUN apt-get update && apt-get install -y git
44
ENV GOCACHE=/tmp/build/.cache

0 commit comments

Comments
 (0)