Skip to content

Commit 68860d0

Browse files
authored
go 1.25 + upgrade containers (#1192)
* go 1.25 + upgrade containers * update workflows * use golangci-lint 2.6.1 * migrate golangci-lint to v2 * fix golang container tag * set minimum go version in go.mod
1 parent 14811c7 commit 68860d0

File tree

10 files changed

+66
-60
lines changed

10 files changed

+66
-60
lines changed

.github/workflows/go-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
go-test:
1212
strategy:
1313
matrix:
14-
go-version: [1.24.1]
14+
go-version: ['1.25']
1515
os: [ubuntu-latest, macos-latest, windows-latest]
1616
runs-on: ${{ matrix.os }}
1717
steps:

.github/workflows/go-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Set up Go
1717
uses: actions/setup-go@v5
1818
with:
19-
go-version: 1.24.1
19+
go-version: '1.25'
2020
- name: Enable pulling Go modules from private sourcegraph/sourcegraph
2121
run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/"
2222
- run: ./dev/go-lint.sh

.github/workflows/goreleaser-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Set up Go
2020
uses: actions/setup-go@v5
2121
with:
22-
go-version: 1.24.1
22+
go-version: '1.25'
2323
- name: Enable pulling Go modules from private sourcegraph/sourcegraph
2424
run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/"
2525
- name: Check GoReleaser config

.github/workflows/goreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ jobs:
181181
- name: Set up Go
182182
uses: actions/setup-go@v5
183183
with:
184-
go-version: 1.24.1
184+
go-version: 1.25
185185
- name: Enable pulling Go modules from private sourcegraph/sourcegraph
186186
run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/"
187187
- run: go test ./...

.github/workflows/scip.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Set up Go
1515
uses: actions/setup-go@v5
1616
with:
17-
go-version: 1.24.1
17+
go-version: 1.25
1818

1919
- name: Set directory to safe for git
2020
run: git config --global --add safe.directory $GITHUB_WORKSPACE

.golangci.yml

Lines changed: 55 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,67 @@
1-
# See explanation of linters at https://golangci-lint.run/usage/linters/
1+
version: "2"
22
linters:
3-
disable-all: true
3+
default: none
44
enable:
55
- bodyclose
66
- depguard
77
- gocritic
8-
- goimports
9-
- gosimple
108
- govet
119
- ineffassign
1210
- nolintlint
1311
- staticcheck
14-
- typecheck
1512
- unconvert
1613
- unused
17-
18-
linters-settings:
19-
depguard:
14+
settings:
15+
depguard:
16+
rules:
17+
main:
18+
deny:
19+
- pkg: errors
20+
desc: Use github.com/sourcegraph/sourcegraph/lib/errors instead
21+
- pkg: github.com/pkg/errors
22+
desc: Use github.com/sourcegraph/sourcegraph/lib/errors instead
23+
- pkg: github.com/cockroachdb/errors
24+
desc: Use github.com/sourcegraph/sourcegraph/lib/errors instead
25+
- pkg: github.com/hashicorp/go-multierror
26+
desc: Use github.com/sourcegraph/sourcegraph/lib/errors instead
27+
- pkg: io/ioutil
28+
desc: The ioutil package has been deprecated
29+
forbidigo:
30+
forbid:
31+
- pattern: fmt\.Errorf
32+
gocritic:
33+
disabled-checks:
34+
- appendAssign
35+
- assignOp
36+
- commentFormatting
37+
- deprecatedComment
38+
- exitAfterDefer
39+
- ifElseChain
40+
- singleCaseSwitch
41+
govet:
42+
disable:
43+
- composites
44+
exclusions:
45+
generated: lax
46+
presets:
47+
- comments
48+
- common-false-positives
49+
- legacy
50+
- std-error-handling
2051
rules:
21-
main:
22-
deny:
23-
- pkg: "errors"
24-
desc: "Use github.com/sourcegraph/sourcegraph/lib/errors instead"
25-
- pkg: "github.com/pkg/errors"
26-
desc: "Use github.com/sourcegraph/sourcegraph/lib/errors instead"
27-
- pkg: "github.com/cockroachdb/errors"
28-
desc: "Use github.com/sourcegraph/sourcegraph/lib/errors instead"
29-
- pkg: "github.com/hashicorp/go-multierror"
30-
desc: "Use github.com/sourcegraph/sourcegraph/lib/errors instead"
31-
- pkg: "io/ioutil"
32-
desc: "The ioutil package has been deprecated"
33-
gocritic:
34-
disabled-checks:
35-
- appendAssign # Too many false positives
36-
- assignOp # Maybe worth adding, but likely not worth the noise
37-
- commentFormatting # No strong benefit
38-
- deprecatedComment # Unnecessary
39-
- exitAfterDefer # Only occurs in auxiliary tools
40-
- ifElseChain # Noisy for not much gain
41-
- singleCaseSwitch # Noisy for not much gain
42-
govet:
43-
disable:
44-
- composites
45-
forbidigo:
46-
forbid:
47-
# Use errors.New instead
48-
- 'fmt\.Errorf'
49-
50-
issues:
51-
exclude-rules:
52-
# Exclude bodyclose lint from tests because leaking connections in tests
53-
# is a non-issue, and checking that adds unnecessary noise
54-
- path: _test\.go
55-
linters:
56-
- bodyclose
57-
58-
run:
59-
timeout: 5m
52+
- linters:
53+
- bodyclose
54+
path: _test\.go
55+
paths:
56+
- third_party$
57+
- builtin$
58+
- examples$
59+
formatters:
60+
enable:
61+
- goimports
62+
exclusions:
63+
generated: lax
64+
paths:
65+
- third_party$
66+
- builtin$
67+
- examples$

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
golang 1.24.1
1+
golang 1.25.4
22
shfmt 3.8.0
33
shellcheck 0.10.0

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
#
55
# Nothing fancy here: we copy in the source code and build on the Alpine Go
66
# image. Refer to .dockerignore to get a sense of what we're not going to copy.
7-
FROM golang:1.24.1-alpine@sha256:43c094ad24b6ac0546c62193baeb3e6e49ce14d3250845d166c77c25f64b0386 AS builder
7+
FROM golang:1.25.4-alpine3.22@sha256:d3f0cf7723f3429e3f9ed846243970b20a2de7bae6a5b66fc5914e228d831bbb AS builder
88

99
COPY . /src
1010
WORKDIR /src
1111
RUN go build ./cmd/src
1212

1313
# This stage should be kept in sync with Dockerfile.release.
14-
FROM alpine:3.22@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1
14+
FROM alpine:3.22@sha256:4b7ce07002c69e8f3d704a9c5d6fd3053be500b7f1c69fc0d80990c2ad8dd412
1515

1616
# needed for `src code-intel upload` and `src actions exec`
1717
RUN apk add --no-cache git

dev/golangci-lint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pushd "$(dirname "${BASH_SOURCE[0]}")/.." >/dev/null
66

77
mkdir -p dev/.bin
88

9-
version="1.64.5"
9+
version="2.6.1"
1010
suffix="${version}-$(go env GOOS)-$(go env GOARCH)"
1111
target="$PWD/dev/.bin/golangci-lint-${suffix}"
1212
url="https://github.com/golangci/golangci-lint/releases/download/v${version}/golangci-lint-${suffix}.tar.gz"

go.mod

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module github.com/sourcegraph/src-cli
22

3-
go 1.24
4-
5-
toolchain go1.24.1
3+
go 1.23.12
64

75
require (
86
cloud.google.com/go/storage v1.30.1
@@ -19,7 +17,6 @@ require (
1917
github.com/dustin/go-humanize v1.0.1
2018
github.com/gobwas/glob v0.2.3
2119
github.com/google/go-cmp v0.6.0
22-
github.com/gorilla/websocket v1.5.3
2320
github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db
2421
github.com/hexops/autogold v1.3.1
2522
github.com/jedib0t/go-pretty/v6 v6.3.7
@@ -51,6 +48,7 @@ require (
5148
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
5249
github.com/google/gnostic-models v0.6.8 // indirect
5350
github.com/google/s2a-go v0.1.4 // indirect
51+
github.com/gorilla/websocket v1.5.3 // indirect
5452
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
5553
github.com/jackc/pgconn v1.14.3 // indirect
5654
github.com/jackc/pgio v1.0.0 // indirect

0 commit comments

Comments
 (0)