Add method for validation of the secret

This commit is contained in:
9seconds
2021-03-12 14:40:07 +03:00
parent 1218f18af9
commit 4daf927a72
3 changed files with 20 additions and 5 deletions
+2 -2
View File
@@ -55,8 +55,8 @@ type Config struct {
}
func (c *Config) Validate() error {
if len(c.Secret.Key) == 0 || c.Secret.Host == "" {
return fmt.Errorf("incorrect secret %s", c.Secret.String())
if !c.Secret.Valid() {
return fmt.Errorf("invalid secret %s", c.Secret.String())
}
return nil