From 2a8e0cf3750d3f789bcd756e39af04f00fe0e738 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Thu, 14 May 2020 23:37:35 +0200 Subject: Verbose variant of 'target' in config --- pkg/config/config.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pkg/config/config.go') diff --git a/pkg/config/config.go b/pkg/config/config.go index 8e2aff6..377365f 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -19,7 +19,7 @@ type Map map[string]interface{} type GlobalOptions struct { Timeout int `yaml:"timeout"` DefaultEmail string `yaml:"default-email"` - Target string `yaml:"target"` + Target Url `yaml:"target"` Parts []string `yaml:"parts"` MaxFailures int `yaml:"max-failures"` } @@ -29,7 +29,7 @@ var DefaultGlobalOptions = GlobalOptions{ Timeout: 30, MaxFailures: 10, DefaultEmail: username() + "@" + Hostname(), - Target: "", + Target: Url{}, Parts: []string{"text", "html"}, } @@ -77,7 +77,7 @@ func WithDefault() *Config { // Validates the configuration against common mistakes func (cfg *Config) Validate() error { - if cfg.Target == "" { + if cfg.Target.Empty() { return fmt.Errorf("No target set!") } -- cgit v1.2.3-54-g00ecf