aboutsummaryrefslogtreecommitdiff
path: root/internal/config
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 /internal/config
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--internal/config/config.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index a37cef1..409cbdf 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -1,6 +1,7 @@
package config
import (
+ "fmt"
"os"
"os/user"
"runtime"
@@ -33,6 +34,14 @@ type Options struct {
InclImages *bool `yaml:"include-images"`
}
+func (c *Config) Validate() error {
+ if c.Target == "" {
+ return fmt.Errorf("No target set!")
+ }
+
+ return nil
+}
+
func (c *Config) WithPartText() bool {
for _, part := range c.Parts {
if part == "text" {