diff options
author | Moritz Poldrack <git@moritz.sh> | 2022-07-31 22:16:40 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-08-01 10:44:52 +0200 |
commit | aaf0a0c65673db4b94c0dc200d7394a192128da1 (patch) | |
tree | 44940936efff55b49a6d359d053f55c7ab824e4d /worker/imap | |
parent | 21dcd440f877192af128c00ca2acbabf68bb3ee3 (diff) | |
download | aerc-aaf0a0c65673db4b94c0dc200d7394a192128da1.tar.gz |
lint: apply new formatting rules
Run `make fmt`.
Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'worker/imap')
-rw-r--r-- | worker/imap/connect.go | 4 | ||||
-rw-r--r-- | worker/imap/fetch.go | 15 | ||||
-rw-r--r-- | worker/imap/list.go | 1 | ||||
-rw-r--r-- | worker/imap/movecopy.go | 1 | ||||
-rw-r--r-- | worker/imap/observer.go | 3 | ||||
-rw-r--r-- | worker/imap/open.go | 10 |
6 files changed, 17 insertions, 17 deletions
diff --git a/worker/imap/connect.go b/worker/imap/connect.go index 5f8cd1c0..bfd95d82 100644 --- a/worker/imap/connect.go +++ b/worker/imap/connect.go @@ -16,7 +16,6 @@ import ( // selects the default inbox. If no error is returned, the imap client will be // in the imap.SelectedState. func (w *IMAPWorker) connect() (*client.Client, error) { - var ( conn *net.TCPConn err error @@ -98,8 +97,7 @@ func (w *IMAPWorker) connect() (*client.Client, error) { // but a valid connection is eventually returned, ensure that it is properly // closed. func newTCPConn(addr string, timeout time.Duration) (*net.TCPConn, error) { - - var errTCPTimeout = fmt.Errorf("tcp connection timeout") + errTCPTimeout := fmt.Errorf("tcp connection timeout") type tcpConn struct { conn *net.TCPConn diff --git a/worker/imap/fetch.go b/worker/imap/fetch.go index 6ef0baca..b6a5509e 100644 --- a/worker/imap/fetch.go +++ b/worker/imap/fetch.go @@ -16,7 +16,8 @@ import ( ) func (imapw *IMAPWorker) handleFetchMessageHeaders( - msg *types.FetchMessageHeaders) { + msg *types.FetchMessageHeaders, +) { toFetch := msg.Uids if imapw.config.cacheEnabled && imapw.cache != nil { toFetch = imapw.getCachedHeaders(msg) @@ -76,8 +77,8 @@ func (imapw *IMAPWorker) handleFetchMessageHeaders( } func (imapw *IMAPWorker) handleFetchMessageBodyPart( - msg *types.FetchMessageBodyPart) { - + msg *types.FetchMessageBodyPart, +) { logging.Infof("Fetching message %d part: %v", msg.Uid, msg.Part) var partHeaderSection imap.BodySectionName @@ -146,8 +147,8 @@ func (imapw *IMAPWorker) handleFetchMessageBodyPart( } func (imapw *IMAPWorker) handleFetchFullMessages( - msg *types.FetchFullMessages) { - + msg *types.FetchFullMessages, +) { logging.Infof("Fetching full messages: %v", msg.Uids) section := &imap.BodySectionName{} items := []imap.FetchItem{ @@ -205,8 +206,8 @@ func (imapw *IMAPWorker) handleFetchMessageFlags(msg *types.FetchMessageFlags) { func (imapw *IMAPWorker) handleFetchMessages( msg types.WorkerMessage, uids []uint32, items []imap.FetchItem, - procFunc func(*imap.Message) error) { - + procFunc func(*imap.Message) error, +) { messages := make(chan *imap.Message) done := make(chan error) diff --git a/worker/imap/list.go b/worker/imap/list.go index 51f4d3e6..67d4c33d 100644 --- a/worker/imap/list.go +++ b/worker/imap/list.go @@ -79,5 +79,4 @@ func (imapw *IMAPWorker) handleSearchDirectory(msg *types.SearchDirectory) { Message: types.RespondTo(msg), Uids: uids, }, nil) - } diff --git a/worker/imap/movecopy.go b/worker/imap/movecopy.go index f1f2b45d..1d25c08c 100644 --- a/worker/imap/movecopy.go +++ b/worker/imap/movecopy.go @@ -38,7 +38,6 @@ func (imapw *IMAPWorker) handleAppendMessage(msg *types.AppendMessage) { Reader: msg.Reader, Length: msg.Length, }); err != nil { - imapw.worker.PostMessage(&types.Error{ Message: types.RespondTo(msg), Error: err, diff --git a/worker/imap/observer.go b/worker/imap/observer.go index 448128c7..866fac62 100644 --- a/worker/imap/observer.go +++ b/worker/imap/observer.go @@ -140,7 +140,8 @@ func (o *observer) DelayedReconnect() error { func (o *observer) emit(errMsg string) { o.log("disconnect done->") o.worker.PostMessage(&types.Done{ - Message: types.RespondTo(&types.Disconnect{})}, nil) + Message: types.RespondTo(&types.Disconnect{}), + }, nil) o.log("connection error->") o.worker.PostMessage(&types.ConnError{ Error: fmt.Errorf(errMsg), diff --git a/worker/imap/open.go b/worker/imap/open.go index 2d76f43e..7abebea4 100644 --- a/worker/imap/open.go +++ b/worker/imap/open.go @@ -25,8 +25,8 @@ func (imapw *IMAPWorker) handleOpenDirectory(msg *types.OpenDirectory) { } func (imapw *IMAPWorker) handleFetchDirectoryContents( - msg *types.FetchDirectoryContents) { - + msg *types.FetchDirectoryContents, +) { logging.Infof("Fetching UID list") searchCriteria, err := parseSearch(msg.FilterCriteria) @@ -88,7 +88,8 @@ var sortFieldMap sortFieldMapT = sortFieldMapT{ } func translateSortCriterions( - cs []*types.SortCriterion) []sortthread.SortCriterion { + cs []*types.SortCriterion, +) []sortthread.SortCriterion { result := make([]sortthread.SortCriterion, 0, len(cs)) for _, c := range cs { if f, ok := sortFieldMap[c.Field]; ok { @@ -99,7 +100,8 @@ func translateSortCriterions( } func (imapw *IMAPWorker) handleDirectoryThreaded( - msg *types.FetchDirectoryThreaded) { + msg *types.FetchDirectoryThreaded, +) { logging.Infof("Fetching threaded UID list") searchCriteria, err := parseSearch(msg.FilterCriteria) |