aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2021-02-21 01:11:04 +0100
committerRené 'Necoro' Neumann <necoro@necoro.eu>2021-02-21 01:11:04 +0100
commitce42a79ef59d2cad6a3d1cee628d86b4a76517ae (patch)
tree8fc141bcf9b2612e6eb3b32010d0cdf679cc0655 /internal
parent97d08c56c47370645865811e789d18552f6fe878 (diff)
downloadfeed2imap-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.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