Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ./...
Expand Down
6 changes: 2 additions & 4 deletions bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand All @@ -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()
}
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
Loading