From c477de646b1c97c8618c8f66d0cf5f4ca0a1c223 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Mon, 23 Oct 2023 16:04:44 +0300 Subject: [PATCH] Update linter to `v1.55.0` Also fix our "new" problems. Signed-off-by: Pavel Karpy --- .github/workflows/go.yml | 2 +- Makefile | 2 +- pkg/services/object/get/util.go | 20 +++++++++++--------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 52ed19d1fd..2dab2ee672 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -48,5 +48,5 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.54.0 + version: v1.55.0 args: --timeout=5m diff --git a/Makefile b/Makefile index 0cb65e7ff6..e6641f6f79 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ HUB_IMAGE ?= nspccdev/neofs HUB_TAG ?= "$(shell echo ${VERSION} | sed 's/^v//')" GO_VERSION ?= 1.21 -LINT_VERSION ?= 1.54.0 +LINT_VERSION ?= 1.55.0 ARCH = amd64 BIN = bin diff --git a/pkg/services/object/get/util.go b/pkg/services/object/get/util.go index 4d166a8eae..2f1d297dcb 100644 --- a/pkg/services/object/get/util.go +++ b/pkg/services/object/get/util.go @@ -212,7 +212,9 @@ func (e *storageEngineWrapper) get(exec *execCtx) (*object.Object, error) { } return r.Header(), nil - } else if rng := exec.ctxRange(); rng != nil { + } + + if rng := exec.ctxRange(); rng != nil { var getRange engine.RngPrm getRange.WithAddress(exec.address()) getRange.WithPayloadRange(rng) @@ -223,17 +225,17 @@ func (e *storageEngineWrapper) get(exec *execCtx) (*object.Object, error) { } return r.Object(), nil - } else { - var getPrm engine.GetPrm - getPrm.WithAddress(exec.address()) + } - r, err := e.engine.Get(getPrm) - if err != nil { - return nil, err - } + var getPrm engine.GetPrm + getPrm.WithAddress(exec.address()) - return r.Object(), nil + r, err := e.engine.Get(getPrm) + if err != nil { + return nil, err } + + return r.Object(), nil } func (w *partWriter) WriteChunk(p []byte) error {