Skip to content

Commit

Permalink
Move init func to main
Browse files Browse the repository at this point in the history
This prevents the code from continuing after printing the help
  • Loading branch information
Philipp Böschen committed Nov 5, 2021
1 parent 8d69fad commit 298a36d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions cmd/gitlab-ci-crawler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

var cfg crawler.Config

func init() {
func main() {
help, err := conf.Parse("", &cfg)
if err != nil {
if errors.Is(err, conf.ErrHelpWanted) {
Expand All @@ -21,9 +21,7 @@ func init() {
}
log.Fatalf("parsing config: %s", err)
}
}

func main() {
c, err := crawler.New(cfg)
if err != nil {
log.Fatalf("failed to setup crawler: %s\n", err)
Expand Down

0 comments on commit 298a36d

Please sign in to comment.