aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-20 18:45:43 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-20 18:45:43 +0200
commitafe2c4919dc2ded2f3b7d796b914dd66fbe78e64 (patch)
treefebdd45c23807fa1e9c22078b7927cd39956f308 /main.go
parent47fa4464d7cf028dd871d48bf6472d97f60b4a79 (diff)
downloadfeed2imap-go-afe2c4919dc2ded2f3b7d796b914dd66fbe78e64.tar.gz
feed2imap-go-afe2c4919dc2ded2f3b7d796b914dd66fbe78e64.tar.bz2
feed2imap-go-afe2c4919dc2ded2f3b7d796b914dd66fbe78e64.zip
Fixes and validation
Diffstat (limited to '')
-rw-r--r--main.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/main.go b/main.go
index 2ce7943..7e6d560 100644
--- a/main.go
+++ b/main.go
@@ -27,9 +27,13 @@ func run() error {
return err
}
+ if err = cfg.Validate(); err != nil {
+ return fmt.Errorf("Configuration invalid: %w", err)
+ }
+
feed.Parse(feeds)
- imapUrl, err := url.Parse(cfg.GlobalConfig["target"].(string))
+ imapUrl, err := url.Parse(cfg.Target)
if err != nil {
return fmt.Errorf("parsing 'target': %w", err)
}