diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8889e9e..cd05fc8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,33 +3,21 @@ name: Build and test on: [push, pull_request] env: - GOLANGCI_LINT_VERSION: v1.54.1 + GOLANGCI_LINT_VERSION: v1.59.1 jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: matrix: go-version: [stable, oldstable] steps: - - name: Set up Go ${{ matrix.go-version }} - uses: actions/setup-go@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} - - name: Check out code - uses: actions/checkout@v2 - - - name: Cache Go modules - uses: actions/cache@v3 - with: - path: | - ~/pkg/mod - ~/.cache/go-build - key: ${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-${{ matrix.go-version }}-go- - - name: Download and check dependencies run: | go mod tidy diff --git a/.golangci.yml b/.golangci.yml index 7aa80bf..5cd67ef 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,7 +1,5 @@ run: timeout: 5m - skip-files: [ ] - skip-dirs: [ ] linters-settings: govet: @@ -73,7 +71,7 @@ linters: - gocyclo - godot - godox - - goerr113 + - err113 - gofmt - gofumpt - goheader @@ -111,7 +109,7 @@ linters: issues: exclude-use-default: false - max-per-linter: 0 + max-issues-per-linter: 0 max-same-issues: 0 exclude: [ ] exclude-rules: diff --git a/go.mod b/go.mod index bc48471..b8c7968 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/go-zookeeper/zk v1.0.3 github.com/kvtools/valkeyrie v1.0.0 - github.com/stretchr/testify v1.8.4 + github.com/stretchr/testify v1.9.0 ) require ( diff --git a/go.sum b/go.sum index c5d3542..a338114 100644 --- a/go.sum +++ b/go.sum @@ -10,8 +10,8 @@ github.com/kvtools/valkeyrie v1.0.0 h1:LAITop2wPoYCMitR24GZZsW0b57hmI+ePD18VRTtO github.com/kvtools/valkeyrie v1.0.0/go.mod h1:bDi/OdhJCSbGPMsCgUQl881yuEweKCSItAtTBI+ZjpU= 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= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/script/docker-compose.yml b/script/docker-compose.yml index 0f14678..4851592 100644 --- a/script/docker-compose.yml +++ b/script/docker-compose.yml @@ -1,5 +1,3 @@ -version: "3.9" - # when running test local, you can specify the image version using the env var REDIS_VERSION. # Example: ZK_VERSION=3.59 make diff --git a/zookeeper.go b/zookeeper.go index 7269dce..2832beb 100644 --- a/zookeeper.go +++ b/zookeeper.go @@ -463,7 +463,6 @@ func (s *Store) get(key string) ([]byte, *zk.Stat, error) { // we try to resync few times if we read SOH or an empty string. for i := 0; i <= syncRetryLimit; i++ { resp, meta, err = s.client.Get(normalize(key)) - if err != nil { if errors.Is(err, zk.ErrNoNode) { return nil, nil, store.ErrKeyNotFound @@ -495,7 +494,6 @@ func (s *Store) getW(key string) ([]byte, *zk.Stat, <-chan zk.Event, error) { // We try to resync few times if we read SOH or an empty string. for i := 0; i <= syncRetryLimit; i++ { resp, meta, ech, err = s.client.GetW(normalize(key)) - if err != nil { if errors.Is(err, zk.ErrNoNode) { return nil, nil, nil, store.ErrKeyNotFound