From d4f5bba459ae7f61f2996710efe9ddd1d8292ba9 Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Fri, 17 Feb 2023 17:13:05 +0300 Subject: [PATCH] [#2] Update lint config, fix lint errors Signed-off-by: Anton Nikiforov --- .golangci.yml | 3 --- netmap/policy_test.go | 1 - pool/mock_test.go | 1 + pool/pool.go | 9 +-------- 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index ebbff9d..67f93e7 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -32,15 +32,12 @@ linters: - revive # some default golangci-lint linters - - deadcode - errcheck - gosimple - ineffassign - staticcheck - - structcheck - typecheck - unused - - varcheck # extra linters - exhaustive diff --git a/netmap/policy_test.go b/netmap/policy_test.go index 85be238..d36cc21 100644 --- a/netmap/policy_test.go +++ b/netmap/policy_test.go @@ -28,7 +28,6 @@ FILTER City EQ SPB AND SSD EQ true OR City EQ SPB AND Rating GE 5 AS SPBSSD`, var p PlacementPolicy for _, testCase := range testCases { - require.NoError(t, p.DecodeString(testCase)) var b strings.Builder diff --git a/pool/mock_test.go b/pool/mock_test.go index 632d342..dc62e0b 100644 --- a/pool/mock_test.go +++ b/pool/mock_test.go @@ -4,6 +4,7 @@ import ( "context" "crypto/ecdsa" "errors" + "go.uber.org/zap" sessionv2 "github.com/TrueCloudLab/frostfs-api-go/v2/session" diff --git a/pool/pool.go b/pool/pool.go index 012b095..5c5a250 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -1664,14 +1664,7 @@ func (p *Pool) log(level zapcore.Level, msg string, fields ...zap.Field) { return } - switch level { - case zap.DebugLevel: - p.logger.Debug(msg, fields...) - case zap.WarnLevel: - p.logger.Warn(msg, fields...) - case zap.ErrorLevel: - p.logger.Error(msg, fields...) - } + p.logger.Log(level, msg, fields...) } func fillDefaultInitParams(params *InitParameters, cache *sessionCache) {