Skip to content

Commit

Permalink
chore: bump go version to 1.21.0 (#4250)
Browse files Browse the repository at this point in the history
  • Loading branch information
notanatol authored and mrekucci committed Oct 16, 2023
1 parent 2309e1e commit 31ce65c
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
uses: golangci/golangci-lint-action@v3
with:
skip-cache: false
version: v1.51
version: v1.54.1
- name: Whitespace check
run: make check-whitespace
- name: go mod tidy check
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ linters:
enable:
- asciicheck
- bidichk
- depguard
# - depguard disable temporary until this issue is resolved: https://github.com/golangci/golangci-lint/issues/3906
- dogsled
- durationcheck
- errcheck
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20 AS build
FROM golang:1.21 AS build

WORKDIR /src
# enable modules caching in separate layer
Expand Down
7 changes: 0 additions & 7 deletions pkg/encryption/encryption.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,3 @@ func GenerateRandomKey(l int) Key {
}
return key
}

func min(x, y int) int {
if x < y {
return x
}
return y
}
3 changes: 1 addition & 2 deletions pkg/skippeers/skippeers.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"time"

"github.com/ethersphere/bee/pkg/swarm"
"golang.org/x/exp/maps"
)

const MaxDuration time.Duration = math.MaxInt64
Expand Down Expand Up @@ -131,7 +130,7 @@ func (l *List) Close() error {
l.wg.Wait()

l.mtx.Lock()
maps.Clear(l.skip)
clear(l.skip)
l.mtx.Unlock()

return nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/leveldbstore/recovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import (
"context"
"encoding/json"
"fmt"
"slices"
"testing"

"github.com/ethersphere/bee/pkg/storage"
"github.com/ethersphere/bee/pkg/storage/leveldbstore"
"github.com/ethersphere/bee/pkg/storage/storageutil"
"github.com/google/go-cmp/cmp"
"golang.org/x/exp/slices"
)

type obj struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/storer/internal/chunkstore/recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ package chunkstore
import (
"context"
"fmt"
"slices"

"github.com/ethersphere/bee/pkg/log"
"github.com/ethersphere/bee/pkg/sharky"
"github.com/ethersphere/bee/pkg/storage"
"github.com/ethersphere/bee/pkg/storage/storageutil"
"github.com/vmihailenco/msgpack/v5"
"golang.org/x/exp/slices"
)

var _ storage.Item = (*pendingTx)(nil)
Expand Down
4 changes: 2 additions & 2 deletions pkg/storer/internal/chunkstore/recovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import (
"context"
"testing"

"github.com/google/go-cmp/cmp/cmpopts"
"golang.org/x/exp/slices"
"slices"

"github.com/ethersphere/bee/pkg/sharky"
"github.com/ethersphere/bee/pkg/storage"
Expand All @@ -18,6 +17,7 @@ import (
"github.com/ethersphere/bee/pkg/storer/internal/chunkstore"
"github.com/ethersphere/bee/pkg/swarm"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/spf13/afero"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/storer/reserve.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"encoding/hex"
"errors"
"fmt"
"slices"
"sync"
"time"

Expand All @@ -18,7 +19,6 @@ import (
"github.com/ethersphere/bee/pkg/storer/internal"
"github.com/ethersphere/bee/pkg/storer/internal/reserve"
"github.com/ethersphere/bee/pkg/swarm"
"golang.org/x/exp/slices"
)

const (
Expand Down
7 changes: 0 additions & 7 deletions pkg/storer/uploadstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,6 @@ func (db *DB) DeleteSession(tagID uint64) error {
func (db *DB) ListSessions(offset, limit int) ([]SessionInfo, error) {
const maxPageSize = 1000

min := func(a, b int) int {
if a < b {
return a
}
return b
}

limit = min(limit, maxPageSize)

tags, err := upload.ListAllTags(db.repo.IndexStore())
Expand Down
2 changes: 1 addition & 1 deletion pkg/topology/mock/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ package mock

import (
"context"
"maps"
"sync"
"time"

"github.com/ethersphere/bee/pkg/p2p"
"github.com/ethersphere/bee/pkg/swarm"
"github.com/ethersphere/bee/pkg/topology"
"golang.org/x/exp/maps"
)

type mock struct {
Expand Down

0 comments on commit 31ce65c

Please sign in to comment.