Skip to content

Commit

Permalink
Fix staticcheck errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
free committed Jan 25, 2019
1 parent 879ed63 commit c9d4563
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions cmd/jiralert/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ var (
allTemplates = template.Must(template.New("").Parse(templates))
homeTemplate = pageTemplate("home")
configTemplate = pageTemplate("config")
errorTemplate = pageTemplate("error")
// errorTemplate = pageTemplate("error")
)

func pageTemplate(name string) *template.Template {
Expand Down Expand Up @@ -104,10 +104,10 @@ func ConfigHandlerFunc(config *jiralert.Config) func(http.ResponseWriter, *http.

// HandleError is an error handler that other handlers defer to in case of error. It is important to not have written
// anything to w before calling HandleError(), or the 500 status code won't be set (and the content might be mixed up).
func HandleError(err error, metricsPath string, w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusInternalServerError)
errorTemplate.Execute(w, &tdata{
DocsUrl: docsUrl,
Err: err,
})
}
//func HandleError(err error, metricsPath string, w http.ResponseWriter, r *http.Request) {
// w.WriteHeader(http.StatusInternalServerError)
// errorTemplate.Execute(w, &tdata{
// DocsUrl: docsUrl,
// Err: err,
// })
//}
2 changes: 1 addition & 1 deletion cmd/jiralert/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func main() {

conf := config.ReceiverByName(data.Receiver)
if conf == nil {
errorHandler(w, http.StatusNotFound, fmt.Errorf("Receiver missing: %s", data.Receiver), unknownReceiver, &data)
errorHandler(w, http.StatusNotFound, fmt.Errorf("receiver missing: %s", data.Receiver), unknownReceiver, &data)
return
}
log.V(1).Infof("Matched receiver: %q", conf.Name)
Expand Down

0 comments on commit c9d4563

Please sign in to comment.