Skip to content

Commit 57dad9f

Browse files
authored
Upgrade Go, dependencies, golangci-lint (#105)
* go: update supported versions * upgrade golangci-lint * github workflow: use supported go versions * go: upgrade toolchain and all dependencies * go: upgrade golangci-lint, disable lll, enable gofmt, govet * add linters to golangci config * add gosec linter * add misspell linter * more upgrades * ci: update go and actions versions
1 parent e4fc659 commit 57dad9f

File tree

10 files changed

+179
-141
lines changed

10 files changed

+179
-141
lines changed

.github/workflows/go.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
go: [ '1.23', '1.22' ]
15+
go: [ '1.25', '1.24' ]
1616

1717
name: Go ${{ matrix.go }} tests
1818
steps:
19-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v5
2020
- name: Setup Go
21-
uses: actions/setup-go@v5
21+
uses: actions/setup-go@v6
2222
with:
2323
go-version: ${{ matrix.go }}
2424
- name: Test

.golangci.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
version = "2"
2+
3+
[linters]
4+
enable = [
5+
"whitespace",
6+
"gosec",
7+
"gocritic",
8+
"bodyclose",
9+
"intrange",
10+
"misspell",
11+
]
12+
13+
[linters.exclusions]
14+
generated = "lax"
15+
presets = [
16+
"comments",
17+
"common-false-positives",
18+
"legacy",
19+
"std-error-handling"
20+
]
21+
paths = [ "third_party$", "builtin$", "examples$" ]
22+
23+
[formatters]
24+
enable = [ "goimports", "gofmt" ]
25+
26+
[formatters.exclusions]
27+
generated = "lax"
28+
paths = [ "third_party$", "builtin$", "examples$" ]

.golangci.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,6 @@ If not, a convenience wrapper for the storage is returned.
6262

6363
## API Stability
6464

65-
We support the last two stable Go versions, currently 1.22 and 1.23.
65+
We support the last two stable Go versions, currently 1.24 and 1.25.
6666

6767
From a API consumer point of view, we do not plan any backward incompatible changes before a v1.0.

backends/s3/credentials.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ type FileSecretsCredentials struct {
2929
// Retrieve implements credentials.Provider.
3030
// It reads files pointed to by p.AccessKeyFilename and p.SecretKeyFilename.
3131
func (c *FileSecretsCredentials) Retrieve() (credentials.Value, error) {
32+
return c.RetrieveWithCredContext(nil)
33+
}
34+
35+
// RetrieveWithCredContext implements credentials.Provider.
36+
// It reads files pointed to by p.AccessKeyFilename and p.SecretKeyFilename.
37+
// The [*credentials.CredContext] argument is ignored.
38+
func (c *FileSecretsCredentials) RetrieveWithCredContext(*credentials.CredContext) (credentials.Value, error) {
3239
keyId, err := os.ReadFile(c.AccessKeyFile)
3340
if err != nil {
3441
return credentials.Value{}, err

backends/s3/credentials_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func TestFileSecretsCredentials(t *testing.T) {
2222

2323
access, secret := secretsPaths(tempDir)
2424

25-
// Instanciate provider (what we're testing).
25+
// Instantiate provider (what we're testing).
2626
provider := &s3.FileSecretsCredentials{
2727
AccessKeyFile: access,
2828
SecretKeyFile: secret,
@@ -169,11 +169,11 @@ func secretsPaths(dir string) (access, secret string) {
169169
// in dir.
170170
func writeSecrets(t testing.TB, dir, adminUser, password string) {
171171
access, secret := secretsPaths(dir)
172-
err := os.WriteFile(access, []byte(adminUser), 0666)
172+
err := os.WriteFile(access, []byte(adminUser), 0600)
173173
if err != nil {
174174
t.Fatal(err)
175175
}
176-
err = os.WriteFile(secret, []byte(password), 0666)
176+
err = os.WriteFile(secret, []byte(password), 0600)
177177
if err != nil {
178178
t.Fatal(err)
179179
}

backends/s3/stream.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ type writerWrapper struct {
6464
}
6565

6666
func (w *writerWrapper) Write(p []byte) (int, error) {
67-
// Not checking the status of ctx explicitely because it will be propagated
67+
// Not checking the status of ctx explicitly because it will be propagated
6868
// from the reader goroutine.
6969
return w.pw.Write(p)
7070
}

go.mod

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,87 @@
11
module github.com/PowerDNS/simpleblob
22

3-
go 1.22
3+
go 1.24.0
44

5-
toolchain go1.23.2
5+
toolchain go1.25.1
66

77
require (
88
github.com/PowerDNS/go-tlsconfig v0.0.0-20221101135152-0956853b28df
9-
github.com/go-logr/logr v1.4.2
10-
github.com/minio/minio-go/v7 v7.0.78
11-
github.com/prometheus/client_golang v1.20.4
12-
github.com/stretchr/testify v1.9.0
13-
github.com/testcontainers/testcontainers-go v0.35.0
14-
github.com/testcontainers/testcontainers-go/modules/minio v0.35.0
9+
github.com/go-logr/logr v1.4.3
10+
github.com/minio/minio-go/v7 v7.0.95
11+
github.com/prometheus/client_golang v1.23.0
12+
github.com/stretchr/testify v1.11.1
13+
github.com/testcontainers/testcontainers-go v0.38.0
14+
github.com/testcontainers/testcontainers-go/modules/minio v0.38.0
1515
gopkg.in/yaml.v2 v2.4.0
1616
)
1717

1818
require (
19-
dario.cat/mergo v1.0.0 // indirect
19+
dario.cat/mergo v1.0.1 // indirect
2020
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
2121
github.com/Microsoft/go-winio v0.6.2 // indirect
2222
github.com/beorn7/perks v1.0.1 // indirect
2323
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
2424
github.com/cespare/xxhash/v2 v2.3.0 // indirect
25-
github.com/containerd/containerd v1.7.18 // indirect
25+
github.com/containerd/errdefs v1.0.0 // indirect
26+
github.com/containerd/errdefs/pkg v0.3.0 // indirect
2627
github.com/containerd/log v0.1.0 // indirect
2728
github.com/containerd/platforms v0.2.1 // indirect
2829
github.com/cpuguy83/dockercfg v0.3.2 // indirect
2930
github.com/davecgh/go-spew v1.1.1 // indirect
3031
github.com/distribution/reference v0.6.0 // indirect
31-
github.com/docker/docker v27.1.1+incompatible // indirect
32+
github.com/docker/docker v28.2.2+incompatible // indirect
3233
github.com/docker/go-connections v0.5.0 // indirect
3334
github.com/docker/go-units v0.5.0 // indirect
3435
github.com/dustin/go-humanize v1.0.1 // indirect
36+
github.com/ebitengine/purego v0.8.4 // indirect
3537
github.com/felixge/httpsnoop v1.0.4 // indirect
3638
github.com/go-ini/ini v1.67.0 // indirect
3739
github.com/go-logr/stdr v1.2.2 // indirect
3840
github.com/go-ole/go-ole v1.2.6 // indirect
39-
github.com/goccy/go-json v0.10.3 // indirect
41+
github.com/goccy/go-json v0.10.5 // indirect
4042
github.com/gogo/protobuf v1.3.2 // indirect
4143
github.com/google/uuid v1.6.0 // indirect
42-
github.com/klauspost/compress v1.17.11 // indirect
43-
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
44+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
45+
github.com/klauspost/compress v1.18.0 // indirect
46+
github.com/klauspost/cpuid/v2 v2.2.11 // indirect
4447
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
45-
github.com/magiconair/properties v1.8.7 // indirect
48+
github.com/magiconair/properties v1.8.10 // indirect
49+
github.com/minio/crc64nvme v1.0.2 // indirect
4650
github.com/minio/md5-simd v1.1.2 // indirect
4751
github.com/moby/docker-image-spec v1.3.1 // indirect
52+
github.com/moby/go-archive v0.1.0 // indirect
4853
github.com/moby/patternmatcher v0.6.0 // indirect
49-
github.com/moby/sys/sequential v0.5.0 // indirect
50-
github.com/moby/sys/user v0.1.0 // indirect
54+
github.com/moby/sys/sequential v0.6.0 // indirect
55+
github.com/moby/sys/user v0.4.0 // indirect
56+
github.com/moby/sys/userns v0.1.0 // indirect
5157
github.com/moby/term v0.5.0 // indirect
5258
github.com/morikuni/aec v1.0.0 // indirect
5359
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
5460
github.com/opencontainers/go-digest v1.0.0 // indirect
55-
github.com/opencontainers/image-spec v1.1.0 // indirect
61+
github.com/opencontainers/image-spec v1.1.1 // indirect
62+
github.com/philhofer/fwd v1.2.0 // indirect
5663
github.com/pkg/errors v0.9.1 // indirect
5764
github.com/pmezard/go-difflib v1.0.0 // indirect
5865
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
59-
github.com/prometheus/client_model v0.6.1 // indirect
60-
github.com/prometheus/common v0.55.0 // indirect
61-
github.com/prometheus/procfs v0.15.1 // indirect
66+
github.com/prometheus/client_model v0.6.2 // indirect
67+
github.com/prometheus/common v0.65.0 // indirect
68+
github.com/prometheus/procfs v0.16.1 // indirect
6269
github.com/rs/xid v1.6.0 // indirect
63-
github.com/shirou/gopsutil/v3 v3.23.12 // indirect
64-
github.com/shoenig/go-m1cpu v0.1.6 // indirect
70+
github.com/shirou/gopsutil/v4 v4.25.5 // indirect
6571
github.com/sirupsen/logrus v1.9.3 // indirect
72+
github.com/tinylib/msgp v1.3.0 // indirect
6673
github.com/tklauser/go-sysconf v0.3.12 // indirect
6774
github.com/tklauser/numcpus v0.6.1 // indirect
68-
github.com/yusufpapurcu/wmi v1.2.3 // indirect
75+
github.com/yusufpapurcu/wmi v1.2.4 // indirect
76+
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
6977
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
70-
go.opentelemetry.io/otel v1.24.0 // indirect
71-
go.opentelemetry.io/otel/metric v1.24.0 // indirect
72-
go.opentelemetry.io/otel/trace v1.24.0 // indirect
73-
golang.org/x/crypto v0.31.0 // indirect
74-
golang.org/x/net v0.30.0 // indirect
75-
golang.org/x/sys v0.28.0 // indirect
76-
golang.org/x/text v0.21.0 // indirect
77-
google.golang.org/protobuf v1.34.2 // indirect
78+
go.opentelemetry.io/otel v1.35.0 // indirect
79+
go.opentelemetry.io/otel/metric v1.35.0 // indirect
80+
go.opentelemetry.io/otel/trace v1.35.0 // indirect
81+
golang.org/x/crypto v0.39.0 // indirect
82+
golang.org/x/net v0.41.0 // indirect
83+
golang.org/x/sys v0.33.0 // indirect
84+
golang.org/x/text v0.26.0 // indirect
85+
google.golang.org/protobuf v1.36.6 // indirect
7886
gopkg.in/yaml.v3 v3.0.1 // indirect
7987
)

0 commit comments

Comments
 (0)