diff options
author | René 'Necoro' Neumann <necoro@necoro.eu> | 2021-02-21 01:11:04 +0100 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.eu> | 2021-02-21 01:11:04 +0100 |
commit | ce42a79ef59d2cad6a3d1cee628d86b4a76517ae (patch) | |
tree | 8fc141bcf9b2612e6eb3b32010d0cdf679cc0655 /internal | |
parent | 97d08c56c47370645865811e789d18552f6fe878 (diff) | |
download | feed2imap-go-ce42a79ef59d2cad6a3d1cee628d86b4a76517ae.tar.gz feed2imap-go-ce42a79ef59d2cad6a3d1cee628d86b4a76517ae.tar.bz2 feed2imap-go-ce42a79ef59d2cad6a3d1cee628d86b4a76517ae.zip |
Clarify code
Diffstat (limited to 'internal')
-rw-r--r-- | internal/msg/msg.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/msg/msg.go b/internal/msg/msg.go index c96bc6c..54c83ac 100644 --- a/internal/msg/msg.go +++ b/internal/msg/msg.go @@ -27,11 +27,11 @@ type Message struct { func (m Messages) Upload(client *imap.Client, folder imap.Folder, reupload bool) error { toStore := make([]string, 0, len(m)) - msgs := make(chan Message, 5) + updateMsgs := make(chan Message, 5) ok := make(chan bool) - go func() { + go func() { /* update goroutine */ errHappened := false - for msg := range msgs { + for msg := range updateMsgs { if err := client.Replace(folder, IdHeader, msg.ID, msg.Content, reupload); err != nil { log.Errorf("Error while updating mail with id '%s' in folder '%s'. Skipping.: %s", msg.ID, folder, err) @@ -46,11 +46,11 @@ func (m Messages) Upload(client *imap.Client, folder imap.Folder, reupload bool) if !msg.IsUpdate { toStore = append(toStore, msg.Content) } else { - msgs <- msg + updateMsgs <- msg } } - close(msgs) + close(updateMsgs) putErr := client.PutMessages(folder, toStore) updOk := <-ok |