From 7e03de0a214563b954fb0f15dddee6aded766f6f Mon Sep 17 00:00:00 2001 From: James Houlahan Date: Thu, 27 Oct 2022 11:14:36 +0200 Subject: [PATCH] Other: Lint fixes --- internal/safe/mutex.go | 2 +- internal/user/types.go | 5 ----- tests/bdd_test.go | 5 ++--- tests/ctx_test.go | 4 +--- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/internal/safe/mutex.go b/internal/safe/mutex.go index bb8c6b44..865c53f8 100644 --- a/internal/safe/mutex.go +++ b/internal/safe/mutex.go @@ -24,7 +24,7 @@ import ( "golang.org/x/exp/slices" ) -var nextMutexID uint64 +var nextMutexID uint64 // nolint:gochecknoglobals // Mutex is a mutex that can be locked and unlocked. type Mutex interface { diff --git a/internal/user/types.go b/internal/user/types.go index 17a79a22..fc22acaf 100644 --- a/internal/user/types.go +++ b/internal/user/types.go @@ -58,11 +58,6 @@ func groupBy[Key comparable, Value any](items []Value, key func(Value) Key) map[ return groups } -// sortAddr returns whether the first address should be sorted before the second. -func sortAddr(addrIDA, addrIDB string, apiAddrs map[string]liteapi.Address) bool { - return apiAddrs[addrIDA].Order < apiAddrs[addrIDB].Order -} - // hexEncode returns the hexadecimal encoding of the given byte slice. func hexEncode(b []byte) []byte { enc := make([]byte, hex.EncodedLen(len(b))) diff --git a/tests/bdd_test.go b/tests/bdd_test.go index a868f53b..165b22fb 100644 --- a/tests/bdd_test.go +++ b/tests/bdd_test.go @@ -27,7 +27,6 @@ import ( "github.com/ProtonMail/proton-bridge/v2/internal/certs" "github.com/ProtonMail/proton-bridge/v2/internal/user" "github.com/cucumber/godog" - "github.com/stretchr/testify/require" "gitlab.protontech.ch/go/liteapi/server/backend" ) @@ -53,8 +52,8 @@ func (s *scenario) reset(tb testing.TB) { s.t = newTestCtx(tb) } -func (s *scenario) close(tb testing.TB) { - require.NoError(tb, s.t.close(context.Background())) +func (s *scenario) close(_ testing.TB) { + s.t.close(context.Background()) } func TestFeatures(testingT *testing.T) { diff --git a/tests/ctx_test.go b/tests/ctx_test.go index 9c3eb81b..e6a31ab6 100644 --- a/tests/ctx_test.go +++ b/tests/ctx_test.go @@ -247,7 +247,7 @@ func (t *testCtx) getLastError() error { return nil } -func (t *testCtx) close(ctx context.Context) error { +func (t *testCtx) close(ctx context.Context) { for _, client := range t.imapClients { if err := client.client.Logout(); err != nil { logrus.WithError(err).Error("Failed to logout IMAP client") @@ -267,8 +267,6 @@ func (t *testCtx) close(ctx context.Context) error { t.api.Close() t.events.close() - - return nil } type eventCollector struct {