aboutsummaryrefslogtreecommitdiff
path: root/internal/imap/imap.go
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-26 17:31:33 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-26 17:31:33 +0200
commit835d5f3547f10ede1997a938d9278a506a089bb7 (patch)
tree8bf73e9a068d1ebacc2fe8888e708dd7ac7ae0c1 /internal/imap/imap.go
parent7ed48c710d1c95b74d3da60d55a4c30a30400617 (diff)
downloadfeed2imap-go-835d5f3547f10ede1997a938d9278a506a089bb7.tar.gz
feed2imap-go-835d5f3547f10ede1997a938d9278a506a089bb7.tar.bz2
feed2imap-go-835d5f3547f10ede1997a938d9278a506a089bb7.zip
Some linting remarks
Diffstat (limited to 'internal/imap/imap.go')
-rw-r--r--internal/imap/imap.go15
1 files changed, 9 insertions, 6 deletions
diff --git a/internal/imap/imap.go b/internal/imap/imap.go
index 8f4c50e..f8c8632 100644
--- a/internal/imap/imap.go
+++ b/internal/imap/imap.go
@@ -11,20 +11,23 @@ import (
)
func newImapClient(url *URL, forceTls bool) (*imapClient.Client, error) {
+ var (
+ c *imapClient.Client
+ err error
+ )
+
if forceTls {
- c, err := imapClient.DialTLS(url.Host, nil)
- if err != nil {
+ if c, err = imapClient.DialTLS(url.Host, nil); err != nil {
return nil, fmt.Errorf("connecting (TLS) to %s: %w", url.Host, err)
}
log.Print("Connected to ", url.Host, " (TLS)")
- return c, nil
} else {
- c, err := imapClient.Dial(url.Host)
- if err != nil {
+ if c, err = imapClient.Dial(url.Host); err != nil {
return nil, fmt.Errorf("connecting to %s: %w", url.Host, err)
}
- return c, nil
}
+
+ return c, nil
}
func (client *Client) connect(url *URL, forceTls bool) (*connection, error) {