diff options
author | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-04-20 18:45:43 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-04-20 18:45:43 +0200 |
commit | afe2c4919dc2ded2f3b7d796b914dd66fbe78e64 (patch) | |
tree | febdd45c23807fa1e9c22078b7927cd39956f308 /internal/config | |
parent | 47fa4464d7cf028dd871d48bf6472d97f60b4a79 (diff) | |
download | feed2imap-go-afe2c4919dc2ded2f3b7d796b914dd66fbe78e64.tar.gz feed2imap-go-afe2c4919dc2ded2f3b7d796b914dd66fbe78e64.tar.bz2 feed2imap-go-afe2c4919dc2ded2f3b7d796b914dd66fbe78e64.zip |
Fixes and validation
Diffstat (limited to 'internal/config')
-rw-r--r-- | internal/config/config.go | 9 |
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" { |