diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 12407b3..dbf0030 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -19,16 +19,16 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-2022, macos-14] - go: [ '1.23', '1.24' ] + go: [ '1.24', '1.25' ] exclude: # Only latest Go version for Windows and MacOS. - os: windows-2022 - go: '1.23' + go: '1.24' - os: macos-14 - go: '1.23' + go: '1.24' # Exclude latest Go version for Ubuntu as Coverage uses it. - os: ubuntu-latest - go: '1.24' + go: '1.25' fail-fast: false steps: - name: Setup go @@ -58,7 +58,7 @@ jobs: uses: actions/setup-go@v5 with: cache: true - go-version: 1.24 + go-version: 1.25 - name: Test and write coverage profile run: go test -coverprofile=coverage.txt -covermode=atomic ./... diff --git a/bench_test.go b/bench_test.go index 8339da4..d264128 100644 --- a/bench_test.go +++ b/bench_test.go @@ -34,11 +34,10 @@ func benchmarkSort(b *testing.B, n int, object []byte) uint64 { oHash := hashableUint64(WrapBytes(object).Hash()) - b.ResetTimer() b.ReportAllocs() var x uint64 - for range b.N { + for b.Loop() { Sort(servers, oHash) x += servers[0].Hash() } @@ -55,11 +54,10 @@ func benchmarkSortByWeight(b *testing.B, n int, object []byte) uint64 { oHash := hashableUint64(WrapBytes(object).Hash()) - b.ResetTimer() b.ReportAllocs() var x uint64 - for range b.N { + for b.Loop() { SortWeighted(servers, weights, oHash) x += servers[0].Hash() } diff --git a/go.mod b/go.mod index 7beb821..5d3e255 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,11 @@ module github.com/nspcc-dev/hrw/v2 -go 1.22 +go 1.24.0 require ( - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.11.1 github.com/twmb/murmur3 v1.1.8 - golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa + golang.org/x/exp v0.0.0-20250819193227-8b4c13bb791b ) require ( diff --git a/go.sum b/go.sum index f18e22f..fda25ed 100644 --- a/go.sum +++ b/go.sum @@ -2,12 +2,12 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/twmb/murmur3 v1.1.8 h1:8Yt9taO/WN3l08xErzjeschgZU2QSrwm1kclYq+0aRg= github.com/twmb/murmur3 v1.1.8/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ= -golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa h1:ELnwvuAXPNtPk1TJRuGkI9fDTwym6AYBu0qzT8AcHdI= -golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= +golang.org/x/exp v0.0.0-20250819193227-8b4c13bb791b h1:DXr+pvt3nC887026GRP39Ej11UATqWDmWuS99x26cD0= +golang.org/x/exp v0.0.0-20250819193227-8b4c13bb791b/go.mod h1:4QTo5u+SEIbbKW1RacMZq1YEfOBqeXa19JeshGi+zc4= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=