From afe2c4919dc2ded2f3b7d796b914dd66fbe78e64 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Mon, 20 Apr 2020 18:45:43 +0200 Subject: Fixes and validation --- internal/config/config.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'internal/config') 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" { -- cgit v1.2.3-54-g00ecf