happy linting
This commit is contained in:
parent
35fe4a04df
commit
8f33ce3a00
@ -1,4 +1,4 @@
|
||||
//nolint:gochecknoglobals
|
||||
//nolint:gochecknoglobals,golint,stylecheck
|
||||
package prepare
|
||||
|
||||
import "embed"
|
||||
|
@ -1,4 +1,4 @@
|
||||
//nolint:gochecknoglobals
|
||||
//nolint:gochecknoglobals,golint,stylecheck
|
||||
package web
|
||||
|
||||
import "embed"
|
||||
|
@ -4,7 +4,6 @@ import (
|
||||
"fmt"
|
||||
"html/template"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
"github.com/rs/zerolog/log"
|
||||
@ -26,7 +25,12 @@ func root(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
t.Execute(w, struct{}{})
|
||||
if err := t.Execute(w, struct{}{}); err != nil {
|
||||
logger.Error().Err(err).Msg("could not execute template")
|
||||
http.Error(w, "could not execute template", http.StatusInternalServerError)
|
||||
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func Run(command *cobra.Command, args []string) {
|
||||
@ -44,15 +48,6 @@ func Run(command *cobra.Command, args []string) {
|
||||
)
|
||||
http.Handle("/metrics", promhttp.Handler())
|
||||
|
||||
go func() {
|
||||
ticker := time.NewTicker(5 * time.Second)
|
||||
|
||||
for {
|
||||
<-ticker.C
|
||||
log.Debug().Msg("ping")
|
||||
}
|
||||
}()
|
||||
|
||||
// Serving this thing.
|
||||
log.Info().Msgf("serving on %s...", l)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user