Skip to content

Commit b7bc25a

Browse files
chore: golang v1.24 (#5083)
1 parent c2f300a commit b7bc25a

File tree

9 files changed

+45
-54
lines changed

9 files changed

+45
-54
lines changed

.github/workflows/go.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
uses: golangci/golangci-lint-action@v6
7171
with:
7272
skip-cache: false
73-
version: v1.61.0
73+
version: v1.64.5
7474
- name: Whitespace check
7575
run: make check-whitespace
7676
- name: go mod tidy check
@@ -88,7 +88,7 @@ jobs:
8888
cache: false
8989
go-version-file: go.mod
9090
- name: Cache Go Modules
91-
uses: actions/cache@v3
91+
uses: actions/cache@v4
9292
with:
9393
path: |
9494
~/.cache/go-build
@@ -97,7 +97,7 @@ jobs:
9797
- name: Test with code coverage
9898
run: make cover=1 test-ci
9999
- name: Upload coverage to Codecov
100-
uses: codecov/codecov-action@v3
100+
uses: codecov/codecov-action@v5
101101
with:
102102
token: ${{ secrets.CODECOV_TOKEN }}
103103
fail_ci_if_error: true

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.23 AS build
1+
FROM golang:1.24 AS build
22

33
WORKDIR /src
44
# enable modules caching in separate layer
@@ -8,12 +8,12 @@ COPY . ./
88

99
RUN make binary
1010

11-
FROM debian:12.7-slim
11+
FROM debian:12.10-slim
1212

1313
ENV DEBIAN_FRONTEND=noninteractive
1414

1515
RUN apt-get update && apt-get install -y --no-install-recommends \
16-
ca-certificates; \
16+
ca-certificates; \
1717
apt-get clean; \
1818
rm -rf /var/lib/apt/lists/*; \
1919
groupadd -r bee --gid 999; \

Dockerfile.dev

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.23 AS build
1+
FROM golang:1.24 AS build
22

33
ARG REACHABILITY_OVERRIDE_PUBLIC=false
44
ARG BATCHFACTOR_OVERRIDE_PUBLIC=5
@@ -13,7 +13,7 @@ RUN make binary \
1313
REACHABILITY_OVERRIDE_PUBLIC=${REACHABILITY_OVERRIDE_PUBLIC} \
1414
BATCHFACTOR_OVERRIDE_PUBLIC=${BATCHFACTOR_OVERRIDE_PUBLIC}
1515

16-
FROM debian:12.7-slim
16+
FROM debian:12.10-slim
1717

1818
ENV DEBIAN_FRONTEND=noninteractive
1919

Dockerfile.goreleaser

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM debian:12.7-slim
1+
FROM debian:12.10-slim
22

33
ENV DEBIAN_FRONTEND=noninteractive
44

55
RUN apt-get update && apt-get install -y --no-install-recommends \
6-
ca-certificates; \
6+
ca-certificates; \
77
apt-get clean; \
88
rm -rf /var/lib/apt/lists/*; \
99
groupadd -r bee --gid 999; \

Dockerfile.scratch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM debian:12.7-slim
1+
FROM debian:12.10-slim
22

33
ENV DEBIAN_FRONTEND=noninteractive
44

55
RUN apt-get update && apt-get install -y --no-install-recommends \
6-
ca-certificates; \
6+
ca-certificates; \
77
groupadd -r bee --gid 999; \
88
useradd -r -g bee --uid 999 --no-log-init -m bee;
99

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GO ?= go
22
GOBIN ?= $$($(GO) env GOPATH)/bin
33
GOLANGCI_LINT ?= $(GOBIN)/golangci-lint
4-
GOLANGCI_LINT_VERSION ?= v1.61.0
4+
GOLANGCI_LINT_VERSION ?= v1.64.5
55
GOGOPROTOBUF ?= protoc-gen-gogofaster
66
GOGOPROTOBUF_VERSION ?= v1.3.1
77
BEEKEEPER_INSTALL_DIR ?= $(GOBIN)

go.mod

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module github.com/ethersphere/bee/v2
22

3-
go 1.23
4-
5-
toolchain go1.23.0
3+
go 1.24
64

75
require (
86
contrib.go.opencensus.io/exporter/prometheus v0.4.2
@@ -56,28 +54,6 @@ require (
5654
resenje.org/web v0.4.3
5755
)
5856

59-
require (
60-
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
61-
github.com/pion/datachannel v1.5.10 // indirect
62-
github.com/pion/dtls/v2 v2.2.12 // indirect
63-
github.com/pion/ice/v2 v2.3.37 // indirect
64-
github.com/pion/interceptor v0.1.37 // indirect
65-
github.com/pion/logging v0.2.2 // indirect
66-
github.com/pion/mdns v0.0.12 // indirect
67-
github.com/pion/randutil v0.1.0 // indirect
68-
github.com/pion/rtcp v1.2.15 // indirect
69-
github.com/pion/rtp v1.8.10 // indirect
70-
github.com/pion/sctp v1.8.35 // indirect
71-
github.com/pion/sdp/v3 v3.0.9 // indirect
72-
github.com/pion/srtp/v2 v2.0.20 // indirect
73-
github.com/pion/stun v0.6.1 // indirect
74-
github.com/pion/transport/v2 v2.2.10 // indirect
75-
github.com/pion/transport/v3 v3.0.7 // indirect
76-
github.com/pion/turn/v2 v2.1.6 // indirect
77-
github.com/pion/webrtc/v3 v3.3.5 // indirect
78-
github.com/wlynxg/anet v0.0.5 // indirect
79-
)
80-
8157
require (
8258
github.com/BurntSushi/toml v1.1.0 // indirect
8359
github.com/Microsoft/go-winio v0.6.1 // indirect
@@ -109,6 +85,7 @@ require (
10985
github.com/go-ole/go-ole v1.3.0 // indirect
11086
github.com/go-playground/locales v0.14.0 // indirect
11187
github.com/go-playground/universal-translator v0.18.0 // indirect
88+
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
11289
github.com/godbus/dbus/v5 v5.1.0 // indirect
11390
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
11491
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
@@ -156,6 +133,23 @@ require (
156133
github.com/opencontainers/runtime-spec v1.2.0 // indirect
157134
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
158135
github.com/pelletier/go-toml v1.8.0 // indirect
136+
github.com/pion/datachannel v1.5.10 // indirect
137+
github.com/pion/dtls/v2 v2.2.12 // indirect
138+
github.com/pion/ice/v2 v2.3.37 // indirect
139+
github.com/pion/interceptor v0.1.37 // indirect
140+
github.com/pion/logging v0.2.2 // indirect
141+
github.com/pion/mdns v0.0.12 // indirect
142+
github.com/pion/randutil v0.1.0 // indirect
143+
github.com/pion/rtcp v1.2.15 // indirect
144+
github.com/pion/rtp v1.8.10 // indirect
145+
github.com/pion/sctp v1.8.35 // indirect
146+
github.com/pion/sdp/v3 v3.0.9 // indirect
147+
github.com/pion/srtp/v2 v2.0.20 // indirect
148+
github.com/pion/stun v0.6.1 // indirect
149+
github.com/pion/transport/v2 v2.2.10 // indirect
150+
github.com/pion/transport/v3 v3.0.7 // indirect
151+
github.com/pion/turn/v2 v2.1.6 // indirect
152+
github.com/pion/webrtc/v3 v3.3.5 // indirect
159153
github.com/pkg/errors v0.9.1 // indirect
160154
github.com/pmezard/go-difflib v1.0.0 // indirect
161155
github.com/prometheus/client_model v0.6.1 // indirect
@@ -179,6 +173,7 @@ require (
179173
github.com/uber/jaeger-lib v2.2.0+incompatible // indirect
180174
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
181175
github.com/wealdtech/go-multicodec v1.4.0 // indirect
176+
github.com/wlynxg/anet v0.0.5 // indirect
182177
go.opencensus.io v0.24.0 // indirect
183178
go.uber.org/dig v1.18.0 // indirect
184179
go.uber.org/fx v1.23.0 // indirect

pkg/api/dirs_test.go

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func TestDirs(t *testing.T) {
4949
jsonhttptest.WithRequestBody(bytes.NewReader(nil)),
5050
jsonhttptest.WithRequestHeader(api.SwarmCollectionHeader, "True"),
5151
jsonhttptest.WithExpectedJSONResponse(jsonhttp.StatusResponse{
52-
Message: api.InvalidRequest.Error(),
52+
Message: api.ErrInvalidRequest.Error(),
5353
Code: http.StatusBadRequest,
5454
}),
5555
jsonhttptest.WithRequestHeader(api.ContentTypeHeader, api.ContentTypeTar),
@@ -66,7 +66,7 @@ func TestDirs(t *testing.T) {
6666
jsonhttptest.WithRequestBody(file),
6767
jsonhttptest.WithRequestHeader(api.SwarmCollectionHeader, "True"),
6868
jsonhttptest.WithExpectedJSONResponse(jsonhttp.StatusResponse{
69-
Message: api.DirectoryStoreError.Error(),
69+
Message: api.ErrDirectoryStoreError.Error(),
7070
Code: http.StatusInternalServerError,
7171
}),
7272
jsonhttptest.WithRequestHeader(api.ContentTypeHeader, api.ContentTypeTar),
@@ -86,7 +86,7 @@ func TestDirs(t *testing.T) {
8686
jsonhttptest.WithRequestBody(tarReader),
8787
jsonhttptest.WithRequestHeader(api.SwarmCollectionHeader, "True"),
8888
jsonhttptest.WithExpectedJSONResponse(jsonhttp.StatusResponse{
89-
Message: api.InvalidContentType.Error(),
89+
Message: api.ErrInvalidContentType.Error(),
9090
Code: http.StatusBadRequest,
9191
}),
9292
jsonhttptest.WithRequestHeader(api.ContentTypeHeader, "other"),
@@ -372,7 +372,6 @@ func TestDirs(t *testing.T) {
372372
// check error document
373373
validateAltPath(t, "_non_existent_file_path_", errorDocumentPath)
374374
}
375-
376375
}
377376
t.Run(tc.name, func(t *testing.T) {
378377
t.Run("tar_upload", func(t *testing.T) {
@@ -520,7 +519,7 @@ func TestDirsEmtpyDir(t *testing.T) {
520519
jsonhttptest.WithRequestHeader(api.SwarmCollectionHeader, "true"),
521520
jsonhttptest.WithRequestHeader(api.ContentTypeHeader, api.ContentTypeTar),
522521
jsonhttptest.WithExpectedJSONResponse(jsonhttp.StatusResponse{
523-
Message: api.EmptyDir.Error(),
522+
Message: api.ErrEmptyDir.Error(),
524523
Code: http.StatusBadRequest,
525524
}),
526525
)
@@ -543,7 +542,7 @@ func tarFiles(t *testing.T, files []f) *bytes.Buffer {
543542
// create tar header and write it
544543
hdr := &tar.Header{
545544
Name: filePath,
546-
Mode: 0600,
545+
Mode: 0o600,
547546
Size: int64(len(file.data)),
548547
}
549548
if err := tw.WriteHeader(hdr); err != nil {
@@ -572,7 +571,7 @@ func tarEmptyDir(t *testing.T) *bytes.Buffer {
572571

573572
hdr := &tar.Header{
574573
Name: "empty/",
575-
Mode: 0600,
574+
Mode: 0o600,
576575
}
577576

578577
if err := tw.WriteHeader(hdr); err != nil {
@@ -605,11 +604,9 @@ func multipartFiles(t *testing.T, files []f) (*bytes.Buffer, string) {
605604
contentType := file.header.Get(api.ContentTypeHeader)
606605
if contentType != "" {
607606
hdr.Set(api.ContentTypeHeader, contentType)
608-
609607
}
610608
if len(file.data) > 0 {
611609
hdr.Set(api.ContentLengthHeader, strconv.Itoa(len(file.data)))
612-
613610
}
614611
part, err := mw.CreatePart(hdr)
615612
if err != nil {

pkg/api/export_test.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,13 @@ type (
2121
)
2222

2323
var (
24-
InvalidContentType = errInvalidContentType
25-
InvalidRequest = errInvalidRequest
26-
DirectoryStoreError = errDirectoryStore
27-
EmptyDir = errEmptyDir
24+
ErrInvalidContentType = errInvalidContentType
25+
ErrInvalidRequest = errInvalidRequest
26+
ErrDirectoryStoreError = errDirectoryStore
27+
ErrEmptyDir = errEmptyDir
2828
)
2929

30-
var (
31-
ContentTypeTar = contentTypeTar
32-
)
30+
var ContentTypeTar = contentTypeTar
3331

3432
var (
3533
ErrNoResolver = errNoResolver
@@ -138,6 +136,7 @@ type HexInvalidByteError = hexInvalidByteError
138136
func MapStructure(input, output interface{}, hooks map[string]func(v string) (string, error)) error {
139137
return mapStructure(input, output, hooks)
140138
}
139+
141140
func NewParseError(entry, value string, cause error) error {
142141
return newParseError(entry, value, cause)
143142
}

0 commit comments

Comments
 (0)