forked from Silverfish/proton-bridge
Other: Lint fixes
This commit is contained in:
@ -24,7 +24,7 @@ import (
|
|||||||
"golang.org/x/exp/slices"
|
"golang.org/x/exp/slices"
|
||||||
)
|
)
|
||||||
|
|
||||||
var nextMutexID uint64
|
var nextMutexID uint64 // nolint:gochecknoglobals
|
||||||
|
|
||||||
// Mutex is a mutex that can be locked and unlocked.
|
// Mutex is a mutex that can be locked and unlocked.
|
||||||
type Mutex interface {
|
type Mutex interface {
|
||||||
|
|||||||
@ -58,11 +58,6 @@ func groupBy[Key comparable, Value any](items []Value, key func(Value) Key) map[
|
|||||||
return groups
|
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.
|
// hexEncode returns the hexadecimal encoding of the given byte slice.
|
||||||
func hexEncode(b []byte) []byte {
|
func hexEncode(b []byte) []byte {
|
||||||
enc := make([]byte, hex.EncodedLen(len(b)))
|
enc := make([]byte, hex.EncodedLen(len(b)))
|
||||||
|
|||||||
@ -27,7 +27,6 @@ import (
|
|||||||
"github.com/ProtonMail/proton-bridge/v2/internal/certs"
|
"github.com/ProtonMail/proton-bridge/v2/internal/certs"
|
||||||
"github.com/ProtonMail/proton-bridge/v2/internal/user"
|
"github.com/ProtonMail/proton-bridge/v2/internal/user"
|
||||||
"github.com/cucumber/godog"
|
"github.com/cucumber/godog"
|
||||||
"github.com/stretchr/testify/require"
|
|
||||||
"gitlab.protontech.ch/go/liteapi/server/backend"
|
"gitlab.protontech.ch/go/liteapi/server/backend"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -53,8 +52,8 @@ func (s *scenario) reset(tb testing.TB) {
|
|||||||
s.t = newTestCtx(tb)
|
s.t = newTestCtx(tb)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *scenario) close(tb testing.TB) {
|
func (s *scenario) close(_ testing.TB) {
|
||||||
require.NoError(tb, s.t.close(context.Background()))
|
s.t.close(context.Background())
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestFeatures(testingT *testing.T) {
|
func TestFeatures(testingT *testing.T) {
|
||||||
|
|||||||
@ -247,7 +247,7 @@ func (t *testCtx) getLastError() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *testCtx) close(ctx context.Context) error {
|
func (t *testCtx) close(ctx context.Context) {
|
||||||
for _, client := range t.imapClients {
|
for _, client := range t.imapClients {
|
||||||
if err := client.client.Logout(); err != nil {
|
if err := client.client.Logout(); err != nil {
|
||||||
logrus.WithError(err).Error("Failed to logout IMAP client")
|
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.api.Close()
|
||||||
|
|
||||||
t.events.close()
|
t.events.close()
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type eventCollector struct {
|
type eventCollector struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user