mirror of
https://github.com/Luzifer/mondash.git
synced 2024-11-10 00:20:02 +00:00
GOLINT: Explicitly ignore errors
This commit is contained in:
parent
2cfd00b245
commit
67eb34ac43
3 changed files with 8 additions and 5 deletions
6
main.go
6
main.go
|
@ -90,7 +90,7 @@ func main() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
s3Storage.Del(params["dashid"])
|
_ = s3Storage.Del(params["dashid"])
|
||||||
http.Error(res, "OK", http.StatusOK)
|
http.Error(res, "OK", http.StatusOK)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -186,10 +186,10 @@ func generateAPIKey() string {
|
||||||
|
|
||||||
func renderTemplate(templateName string, context pongo2.Context, res http.ResponseWriter) {
|
func renderTemplate(templateName string, context pongo2.Context, res http.ResponseWriter) {
|
||||||
if tpl, ok := templates[templateName]; ok {
|
if tpl, ok := templates[templateName]; ok {
|
||||||
tpl.ExecuteWriter(context, res)
|
_ = tpl.ExecuteWriter(context, res)
|
||||||
} else {
|
} else {
|
||||||
res.WriteHeader(http.StatusInternalServerError)
|
res.WriteHeader(http.StatusInternalServerError)
|
||||||
res.Write([]byte(fmt.Sprintf("Template %s not found!", templateName)))
|
_, _ = res.Write([]byte(fmt.Sprintf("Template %s not found!", templateName)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ func loadDashboard(dashid string) (*dashboard, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp := &dashboard{DashboardID: dashid}
|
tmp := &dashboard{DashboardID: dashid}
|
||||||
json.Unmarshal(data, tmp)
|
_ = json.Unmarshal(data, tmp)
|
||||||
|
|
||||||
return tmp, nil
|
return tmp, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,10 @@ func runWelcomePage() {
|
||||||
url := fmt.Sprintf("%s/welcome/beer_available", baseURL)
|
url := fmt.Sprintf("%s/welcome/beer_available", baseURL)
|
||||||
req, _ := http.NewRequest("PUT", url, bytes.NewBuffer(body))
|
req, _ := http.NewRequest("PUT", url, bytes.NewBuffer(body))
|
||||||
req.Header.Add("Authorization", welcomeAPIToken)
|
req.Header.Add("Authorization", welcomeAPIToken)
|
||||||
http.DefaultClient.Do(req)
|
_, err = http.DefaultClient.Do(req)
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("[WelcomeRunner] %s", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue