Skip to content

Commit

Permalink
unblock issues caused by bad validation (#85)
Browse files Browse the repository at this point in the history
* unblock issues caused by bad validation

* remove commented out code
  • Loading branch information
Preslav Mihaylov authored Oct 25, 2020
1 parent a83a1a2 commit b9b3e43
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ func main() {
log.Fatalf("couldn't open configuration file: %s\n", err)
}

err = authmanager.AcquireToken(localCfg)
if err != nil {
log.Fatalf("couldn't acquire token from config: %s\n", err)
}

if errors := validation.Validate(localCfg); len(errors) > 0 {
for _, err := range errors {
log.Println(err)
Expand All @@ -50,11 +55,6 @@ func main() {
os.Exit(1)
}

err = authmanager.AcquireToken(localCfg)
if err != nil {
log.Fatalf("couldn't acquire token from config: %s\n", err)
}

baseURL, err := issuetracker.BaseURLFor(localCfg.IssueTracker, localCfg.Origin)
if err != nil {
log.Fatalf("couldn't get base url for origin %s & issue tracker %s: %s\n",
Expand Down
4 changes: 0 additions & 4 deletions validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ func Validate(cfg *config.Local) []error {
errs = append(errs, err)
}

if err := validateIssueTrackerExists(cfg); err != nil {
errs = append(errs, err)
}

if err := validateAuthType(cfg); err != nil {
errs = append(errs, err)
}
Expand Down

0 comments on commit b9b3e43

Please sign in to comment.