Add method to validate configuration

This commit is contained in:
2021-01-20 23:09:37 -06:00
parent b9e98679a1
commit c3495ac57a
2 changed files with 12 additions and 3 deletions

View File

@ -33,9 +33,8 @@ func Main(args []string) (int, error) {
config.AccessToken = envAccessToken
}
if config.AccessToken == "" {
err = errors.New("fatal: access token is not set")
return ExitError, err
if err = config.Validate(); err != nil {
return ExitError, fmt.Errorf("fatal: %s", err)
}
flag.Parse()