Pārlūkot izejas kodu

pkg/cmd/grafana-server/main.go: Fix error value not checked

See,
$ gometalinter --vendor --deadline 10m --disable-all --enable=errcheck ./...
pkg/cmd/grafana-server/main.go:56:23:warning: error return value not checked (http.ListenAndServe(fmt.Sprintf("localhost:%d", *profilePort), nil)) (errcheck)
Mario Trangoni 7 gadi atpakaļ
vecāks
revīzija
a6d54d5d9f
1 mainītis faili ar 4 papildinājumiem un 1 dzēšanām
  1. 4 1
      pkg/cmd/grafana-server/main.go

+ 4 - 1
pkg/cmd/grafana-server/main.go

@@ -53,7 +53,10 @@ func main() {
 	if *profile {
 		runtime.SetBlockProfileRate(1)
 		go func() {
-			http.ListenAndServe(fmt.Sprintf("localhost:%d", *profilePort), nil)
+			err := http.ListenAndServe(fmt.Sprintf("localhost:%d", *profilePort), nil)
+			if err != nil {
+				panic(err)
+			}
 		}()
 
 		f, err := os.Create("trace.out")