Skip to content

Commit 72447d3

Browse files
committed
multi: bump Go to 1.24.6
Fixed new linter errors using "golangci-lint run --fix". Some cases were adjusted manually.
1 parent 614f591 commit 72447d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+242
-250
lines changed

.github/actions/setup-go/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ runs:
5252
# The key is used to create and later look up the cache. It's made of
5353
# four parts:
5454
# - The base part is made from the OS name, Go version and a
55-
# job-specified key prefix. Example: `linux-go-1.23.12-unit-test-`.
56-
# It ensures that a job running on Linux with Go 1.23 only looks for
55+
# job-specified key prefix. Example: `linux-go-1.24.6-unit-test-`.
56+
# It ensures that a job running on Linux with Go 1.24 only looks for
5757
# caches from the same environment.
5858
# - The unique part is the `hashFiles('**/go.sum')`, which calculates a
5959
# hash (a fingerprint) of the go.sum file.

.github/workflows/main.yml

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

4141
# If you change this please also update GO_VERSION in Makefile (then run
4242
# `make lint` to see where else it needs to be updated as well).
43-
GO_VERSION: 1.23.12
43+
GO_VERSION: 1.24.6
4444

4545
jobs:
4646
static-checks:

.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.23.12
15+
GO_VERSION: 1.24.6
1616

1717
jobs:
1818
########################

.golangci.yml

Lines changed: 1 addition & 1 deletion
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.23.12"
4+
go: "1.24.6"
55

66
# Abort after 10 minutes.
77
timeout: 10m

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.23.12-alpine as builder
3+
FROM golang:1.24.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
@@ -28,7 +28,7 @@ ACTIVE_GO_VERSION_MINOR := $(shell echo $(ACTIVE_GO_VERSION) | cut -d. -f2)
2828
# GO_VERSION is the Go version used for the release build, docker files, and
2929
# GitHub Actions. This is the reference version for the project. All other Go
3030
# versions are checked against this version.
31-
GO_VERSION = 1.23.12
31+
GO_VERSION = 1.24.6
3232

3333
GOBUILD := $(GOCC) build -v
3434
GOINSTALL := $(GOCC) install -v

accessman_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package lnd
22

33
import (
4-
"context"
54
"testing"
65

76
"github.com/btcsuite/btcd/btcec/v2"
@@ -490,7 +489,7 @@ func TestAssignPeerPermsBypassExisting(t *testing.T) {
490489
func TestHasPeer(t *testing.T) {
491490
t.Parallel()
492491

493-
ctx := context.Background()
492+
ctx := t.Context()
494493

495494
// Create a testing accessMan.
496495
a := &accessMan{
@@ -708,7 +707,7 @@ func TestAddPeerAccessOutbound(t *testing.T) {
708707
// accessman's internal state based on the peer's status.
709708
func TestRemovePeerAccess(t *testing.T) {
710709
t.Parallel()
711-
ctx := context.Background()
710+
ctx := t.Context()
712711

713712
// Create a testing accessMan.
714713
a := &accessMan{

autopilot/betweenness_centrality_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package autopilot
22

33
import (
4-
"context"
54
"fmt"
65
"testing"
76

@@ -32,7 +31,7 @@ func TestBetweennessCentralityMetricConstruction(t *testing.T) {
3231
// Tests that empty graph results in empty centrality result.
3332
func TestBetweennessCentralityEmptyGraph(t *testing.T) {
3433
t.Parallel()
35-
ctx := context.Background()
34+
ctx := t.Context()
3635

3736
centralityMetric, err := NewBetweennessCentralityMetric(1)
3837
require.NoError(
@@ -64,7 +63,7 @@ func TestBetweennessCentralityEmptyGraph(t *testing.T) {
6463
// Test betweenness centrality calculating using an example graph.
6564
func TestBetweennessCentralityWithNonEmptyGraph(t *testing.T) {
6665
t.Parallel()
67-
ctx := context.Background()
66+
ctx := t.Context()
6867

6968
workers := []int{1, 3, 9, 100}
7069

autopilot/externalscoreattach_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package autopilot_test
22

33
import (
4-
"context"
54
"testing"
65

76
"github.com/btcsuite/btcd/btcec/v2"
@@ -23,7 +22,7 @@ func randKey() (*btcec.PublicKey, error) {
2322
// ExternalScoreAttachment correctly reflects the scores we set last.
2423
func TestSetNodeScores(t *testing.T) {
2524
t.Parallel()
26-
ctx := context.Background()
25+
ctx := t.Context()
2726

2827
const name = "externalscore"
2928

autopilot/prefattach_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ var chanGraphs = []struct {
7676
// empty graph, the NodeSores function always returns a score of 0.
7777
func TestPrefAttachmentSelectEmptyGraph(t *testing.T) {
7878
t.Parallel()
79-
ctx := context.Background()
79+
ctx := t.Context()
8080
prefAttach := NewPrefAttachment()
8181

8282
// Create a random public key, which we will query to get a score for.
@@ -116,7 +116,7 @@ func TestPrefAttachmentSelectEmptyGraph(t *testing.T) {
116116
// and the funds are appropriately allocated across each peer.
117117
func TestPrefAttachmentSelectTwoVertexes(t *testing.T) {
118118
t.Parallel()
119-
ctx := context.Background()
119+
ctx := t.Context()
120120

121121
prand.Seed(time.Now().Unix())
122122

@@ -203,7 +203,7 @@ func TestPrefAttachmentSelectTwoVertexes(t *testing.T) {
203203
// allocate all funds to each vertex (up to the max channel size).
204204
func TestPrefAttachmentSelectGreedyAllocation(t *testing.T) {
205205
t.Parallel()
206-
ctx := context.Background()
206+
ctx := t.Context()
207207

208208
prand.Seed(time.Now().Unix())
209209

@@ -316,7 +316,7 @@ func TestPrefAttachmentSelectGreedyAllocation(t *testing.T) {
316316
// of zero during scoring.
317317
func TestPrefAttachmentSelectSkipNodes(t *testing.T) {
318318
t.Parallel()
319-
ctx := context.Background()
319+
ctx := t.Context()
320320

321321
prand.Seed(time.Now().Unix())
322322

0 commit comments

Comments
 (0)