mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-17 23:56:56 +00:00
Other: Linter fixes after bumping linter version
This commit is contained in:
@ -14,9 +14,9 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
defaultFlags = imap.NewFlagSet(imap.FlagSeen, imap.FlagFlagged, imap.FlagDeleted)
|
||||
defaultPermanentFlags = imap.NewFlagSet(imap.FlagSeen, imap.FlagFlagged, imap.FlagDeleted)
|
||||
defaultAttributes = imap.NewFlagSet()
|
||||
defaultFlags = imap.NewFlagSet(imap.FlagSeen, imap.FlagFlagged, imap.FlagDeleted) // nolint:gochecknoglobals
|
||||
defaultPermanentFlags = imap.NewFlagSet(imap.FlagSeen, imap.FlagFlagged, imap.FlagDeleted) // nolint:gochecknoglobals
|
||||
defaultAttributes = imap.NewFlagSet() // nolint:gochecknoglobals
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@ -75,7 +75,6 @@ func (session *smtpSession) Mail(from string, opts smtp.MailOptions) error {
|
||||
logrus.Info("SMTP session mail")
|
||||
|
||||
return session.apiAddrs.GetErr(func(apiAddrs []liteapi.Address) error {
|
||||
|
||||
switch {
|
||||
case opts.RequireTLS:
|
||||
return ErrNotImplemented
|
||||
|
||||
@ -1,12 +1,20 @@
|
||||
package user
|
||||
|
||||
import "reflect"
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
)
|
||||
|
||||
func mapTo[From, To any](from []From) []To {
|
||||
to := make([]To, 0, len(from))
|
||||
|
||||
for _, from := range from {
|
||||
to = append(to, reflect.ValueOf(from).Convert(reflect.TypeOf(to).Elem()).Interface().(To))
|
||||
val, ok := reflect.ValueOf(from).Convert(reflect.TypeOf(to).Elem()).Interface().(To)
|
||||
if !ok {
|
||||
panic(fmt.Sprintf("cannot convert %T to %T", from, *new(To)))
|
||||
}
|
||||
|
||||
to = append(to, val)
|
||||
}
|
||||
|
||||
return to
|
||||
|
||||
@ -22,8 +22,8 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
EventPeriod = 20 * time.Second
|
||||
EventJitter = 20 * time.Second
|
||||
EventPeriod = 20 * time.Second // nolint:gochecknoglobals
|
||||
EventJitter = 20 * time.Second // nolint:gochecknoglobals
|
||||
)
|
||||
|
||||
type User struct {
|
||||
@ -31,9 +31,9 @@ type User struct {
|
||||
client *liteapi.Client
|
||||
eventCh *queue.QueuedChannel[events.Event]
|
||||
|
||||
apiUser *safe.Type[liteapi.User]
|
||||
apiUser *safe.Value[liteapi.User]
|
||||
apiAddrs *safe.Slice[liteapi.Address]
|
||||
settings *safe.Type[liteapi.MailSettings]
|
||||
settings *safe.Value[liteapi.MailSettings]
|
||||
|
||||
userKR *crypto.KeyRing
|
||||
addrKRs map[string]*crypto.KeyRing
|
||||
@ -90,9 +90,9 @@ func New(ctx context.Context, encVault *vault.User, client *liteapi.Client, apiU
|
||||
client: client,
|
||||
eventCh: queue.NewQueuedChannel[events.Event](0, 0),
|
||||
|
||||
apiUser: safe.NewType(apiUser),
|
||||
apiUser: safe.NewValue(apiUser),
|
||||
apiAddrs: safe.NewSlice(apiAddrs),
|
||||
settings: safe.NewType(settings),
|
||||
settings: safe.NewValue(settings),
|
||||
|
||||
userKR: userKR,
|
||||
addrKRs: addrKRs,
|
||||
|
||||
Reference in New Issue
Block a user