aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal/msg/msg.go10
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