From e36bd50224fa8005e37973fa5bc60273b9b39a0d Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Fri, 9 Aug 2024 13:26:34 +0300 Subject: [PATCH 1/3] go.mod: upgrade to Go 1.21 min Fixes #13. Notice that `slices` can't be reused effectively here because of the way `sliceToSort.Swap` works, it manages two slices at once. Update workflows to drop 1.20 as well, follow new versioning policy, see https://github.com/nspcc-dev/.github/issues/30. Signed-off-by: Roman Khimov --- .github/workflows/go.yml | 8 +------- go.mod | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 9e5caee..b5ee019 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -19,19 +19,13 @@ jobs: strategy: matrix: os: [ubuntu-22.04, windows-2022, macos-12, macos-14] - go: [ '1.20', '1.21', '1.22' ] + go: [ '1.21', '1.22' ] exclude: # Only latest Go version for Windows and MacOS. - - os: windows-2022 - go: '1.20' - os: windows-2022 go: '1.21' - - os: macos-12 - go: '1.20' - os: macos-12 go: '1.21' - - os: macos-14 - go: '1.20' - os: macos-14 go: '1.21' # Exclude latest Go version for Ubuntu as Coverage uses it. diff --git a/go.mod b/go.mod index 59c807a..3d9cc4f 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/nspcc-dev/hrw/v2 -go 1.20 +go 1.21 require ( github.com/stretchr/testify v1.8.4 From 94b23f4f583dbef11b3e932ee7db43a74c112c7b Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Fri, 9 Aug 2024 13:31:40 +0300 Subject: [PATCH 2/3] go.mod: update all dependencies Signed-off-by: Roman Khimov --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 3d9cc4f..abd4a04 100644 --- a/go.mod +++ b/go.mod @@ -3,9 +3,9 @@ module github.com/nspcc-dev/hrw/v2 go 1.21 require ( - github.com/stretchr/testify v1.8.4 + github.com/stretchr/testify v1.9.0 github.com/twmb/murmur3 v1.1.8 - golang.org/x/exp v0.0.0-20240213143201-ec583247a57a + golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa ) require ( diff --git a/go.sum b/go.sum index 58035f8..f18e22f 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.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +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/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-20240213143201-ec583247a57a h1:HinSgX1tJRX3KsL//Gxynpw5CTOAIPhgL4W8PNiIpVE= -golang.org/x/exp v0.0.0-20240213143201-ec583247a57a/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +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= 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= From ea14835ab842ec4c96f8e0eb576c78fbed949259 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Fri, 9 Aug 2024 13:33:17 +0300 Subject: [PATCH 3/3] golangci: fix deprecated configs Follow https://github.com/nspcc-dev/neo-go/pull/3511, use newer syntax and defaults. Signed-off-by: Roman Khimov --- .golangci.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 54a2261..aea0561 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -12,7 +12,8 @@ run: # output configuration options output: # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" - format: tab + formats: + - format: tab # all available settings of specific linters linters-settings: @@ -21,9 +22,6 @@ linters-settings: # 'default' case is present, even if all enum members aren't listed in the # switch default-signifies-exhaustive: true - govet: - # report about shadowed variables - check-shadowing: false linters: enable: