Browse Source

Don't redefine cfg in pusher's main

Brendan Abolivier 6 years ago
parent
commit
cf8df92574
Signed by: Brendan Abolivier <contact@brendanabolivier.com> GPG key ID: 8EF1500759F70623
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      src/pusher/main.go

+ 4
- 2
src/pusher/main.go View File

20
 )
20
 )
21
 
21
 
22
 func main() {
22
 func main() {
23
+	var err error
24
+
23
 	flag.Parse()
25
 	flag.Parse()
24
 
26
 
25
-	cfg, err := config.Load(*configFile)
27
+	cfg, err = config.Load(*configFile)
26
 	if err != nil {
28
 	if err != nil {
27
 		panic(err)
29
 		panic(err)
28
 	}
30
 	}
29
 
31
 
30
 	grafanaClient = grafana.NewClient(cfg.Grafana.BaseURL, cfg.Grafana.APIKey)
32
 	grafanaClient = grafana.NewClient(cfg.Grafana.BaseURL, cfg.Grafana.APIKey)
31
 
33
 
32
-	if err := SetupWebhook(cfg); err != nil {
34
+	if err = SetupWebhook(cfg); err != nil {
33
 		panic(err)
35
 		panic(err)
34
 	}
36
 	}
35
 }
37
 }