Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ env:

# If you change this value, please change it in the following files as well:
# /Dockerfile
GO_VERSION: 1.26.8
GO_VERSION: 1.27.3

jobs:
########################
Expand Down
209 changes: 104 additions & 105 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,124 +1,123 @@
version: "2"
run:
# If you change this please also update GO_VERSION in the Makefile.
go: "1.27.3"

# timeout for analysis
timeout: 4m

linters-settings:
govet:
# Don't report about shadowed variables
check-shadowing: false
gofmt:
# simplify code: gofmt with `-s` option, true by default
simplify: true
tagliatelle:
case:
rules:
json: snake
whitespace:
multi-func: true
multi-if: true
gosec:
excludes:
- G402 # Look for bad TLS connection settings.
- G306 # Poor file permissions used when writing to a new file.
- G601 # Implicit memory aliasing in for loop.
- G115 # Integer overflow in conversion.
staticcheck:
checks: ["-SA1019"]

linters:
enable-all: true
default: all
disable:
# Global variables are used in many places throughout the code base.
- gochecknoglobals

# Some lines are over 80 characters on purpose and we don't want to make them
# even longer by marking them as 'nolint'.
- lll

# We want to allow short variable names.
- varnamelen

# We want to allow TODOs.
- godox

# We have long functions, especially in tests. Moving or renaming those would
# trigger funlen problems that we may not want to solve at that time.
- funlen

# Disable for now as we haven't yet tuned the sensitivity to our codebase
# yet. Enabling by default for example, would also force new contributors to
# potentially extensively refactor code, when they want to smaller change to
# land.
- gocyclo
- gocognit
- containedctx
- contextcheck
- copyloopvar
- cyclop

# Instances of table driven tests that don't pre-allocate shouldn't trigger
# the linter.
- prealloc

# Init functions are used by loggers throughout the codebase.
- gochecknoinits

# Causes stack overflow, see https://github.com/polyfloyd/go-errorlint/issues/19.
- depguard
- dogsled
- err113
- errchkjson
- errname
- errorlint

# New linters that need a code adjustment first.
- intrange
- revive
- gosmopolitan
- exhaustive
- exhaustruct
# v2 rename of exhaustruct; keep the existing decision.
- exhaustruct_v5
- forbidigo
- forcetypeassert
- funlen
# New in golangci-lint v2; these need code adjustments first and are
# tracked separately from this toolchain bump.
- funcorder
- modernize
- noinlineerr
- gochecknoglobals
- gochecknoinits
- gocognit
- goconst
- copyloopvar
- wrapcheck
- depguard
- inamedparam
- protogetter
- perfsprint
- tagalign
- testifylint
- nolintlint
- paralleltest
- tparallel
- testpackage
- gofumpt
- gocyclo
# Superseded by gomodguard_v2, enabled below.
- gomodguard
- godox
- gomoddirectives
- gosmopolitan
- inamedparam
- interfacebloat
- intrange
- ireturn
- lll
- maintidx
- nlreturn
- dogsled
- gci
- containedctx
- contextcheck
- errname
- exhaustruct
- err113
- noctx
- mnd
- nestif
- wsl
- exhaustive
- forcetypeassert
- nilerr
- nilnil
- stylecheck
- thelper
- nlreturn
- noctx
- nolintlint
- nosprintfhostport
- errchkjson
- revive
- paralleltest
- perfsprint
- prealloc
- promlinter
- forbidigo
- interfacebloat

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

- protogetter
- revive
- tagalign
- testifylint
- testpackage
- thelper
- tparallel
- varnamelen
- wrapcheck
- wsl
# v2 rename of wsl; keep the existing decision.
- wsl_v5
enable:
# v2 rename of gomodguard, which was active before the migration.
- gomodguard_v2
settings:
gosec:
excludes:
- G402
- G306
- G601
- G115
staticcheck:
checks:
- -SA1019
tagliatelle:
case:
rules:
json: snake
whitespace:
multi-if: true
multi-func: true
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- gosec
path: _test\.go
paths:
- third_party$
- builtin$
- examples$
issues:
# Only show newly introduced problems.
new-from-rev: c5b37702e0bead2408ba72aad792ea4ff9fc930f

exclude-rules:
# Exclude gosec from running for tests so that tests with weak randomness
# (math/rand) will pass the linter.
- path: _test\.go
linters:
- gosec
formatters:
enable:
- gofmt
- goimports
settings:
gofmt:
simplify: true
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=${BUILDPLATFORM} golang:1.26.8-alpine as builder
FROM --platform=${BUILDPLATFORM} golang:1.27.3-alpine as builder

# Force Go to use the cgo based DNS resolver. This is required to ensure DNS
# queries required to connect to linked containers succeed.
Expand Down
8 changes: 7 additions & 1 deletion auctioneer/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,13 @@ func TestHandleServerShutdownPartialResubscribeFailure(t *testing.T) {
// after the first handshake's error. With a fix, it returns after
// all three handshakes complete.
select {
case <-shutdownErr:
case err := <-shutdownErr:
// One handshake fails by design here, so a non-nil error is
// an expected outcome. This test only requires that the call
// returns; the assertion below covers what it must have done
// before returning.
_ = err

case <-time.After(2 * time.Second):
t.Fatal("HandleServerShutdown did not return")
}
Expand Down
2 changes: 1 addition & 1 deletion auctioneerrpc/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ require (
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
)

go 1.23.6
go 1.27.3
2 changes: 1 addition & 1 deletion gen/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.26.8-bookworm
FROM golang:1.27.3-bookworm

RUN go install go.uber.org/mock/mockgen@v0.4.0

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ replace github.com/lightninglabs/pool/auctioneerrpc => ./auctioneerrpc

replace github.com/lightninglabs/pool/poolrpc => ./poolrpc

go 1.26.8
go 1.27.3

// Match the lnd source revision, including its SQL schema and pgx v5 fixes.
replace github.com/lightningnetwork/lnd/sqldb => github.com/lightningnetwork/lnd/sqldb v1.0.13-0.20260925031608-f2963ce1fd19
2 changes: 1 addition & 1 deletion poolrpc/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22.3-bookworm
FROM golang:1.27.3-bookworm

RUN apt-get update && apt-get install -y \
git \
Expand Down
2 changes: 1 addition & 1 deletion poolrpc/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ replace github.com/lightninglabs/pool/auctioneerrpc => ../auctioneerrpc

replace google.golang.org/protobuf => github.com/lightninglabs/protobuf-go-hex-display v1.34.2-hex-display

go 1.23.6
go 1.27.3
7 changes: 4 additions & 3 deletions tools/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM golang:1.26.8-bookworm
FROM golang:1.27.3-bookworm

RUN apt-get update && apt-get install -y git
RUN apt-get update && apt-get install -y git \
&& git config --global --add safe.directory /build
ENV GOCACHE=/tmp/build/.cache
ENV GOMODCACHE=/tmp/build/.modcache
ENV GOFLAGS="-buildvcs=false"
Expand All @@ -11,7 +12,7 @@ RUN cd /tmp \
&& mkdir -p /tmp/build/.cache \
&& mkdir -p /tmp/build/.modcache \
&& cd /tmp/tools \
&& go install -trimpath github.com/golangci/golangci-lint/cmd/golangci-lint \
&& go install -trimpath github.com/golangci/golangci-lint/v2/cmd/golangci-lint \
&& chmod -R 777 /tmp/build/

WORKDIR /build
Loading
Loading