From 5be397a6a8b23b047e41807384d155cf9a21aa58 Mon Sep 17 00:00:00 2001 From: Chun-Hung Tseng Date: Tue, 25 Jun 2024 11:45:53 +0200 Subject: [PATCH] Fix a linter issue golangci-lint reports the following issue: storage/mvcc/kvstore.go:312:27: (*store).restore - result 0 (error) is always nil (unparam) It's due to the fact that both Attach() and compactLockfree() within the function restore() are able to return an error, but we only log them in the current implementation. Thus, the return value restore() is always nil, hence the linter warning. We have agreed to suppress the linter warning for now [1]. Reference: [1] https://github.com/etcd-io/etcd/pull/18228#issuecomment-2187309957 Signed-off-by: Chun-Hung Tseng --- server/storage/mvcc/kvstore.go | 1 + 1 file changed, 1 insertion(+) diff --git a/server/storage/mvcc/kvstore.go b/server/storage/mvcc/kvstore.go index 2391361fc..8c9732386 100644 --- a/server/storage/mvcc/kvstore.go +++ b/server/storage/mvcc/kvstore.go @@ -309,6 +309,7 @@ func (s *store) Restore(b backend.Backend) error { return s.restore() } +//nolint:unparam func (s *store) restore() error { s.setupMetricsReporter()