resolve linter issues

This commit is contained in:
David Christofas
2021-02-24 14:48:22 +01:00
parent 3328f9acb7
commit cc417c6ee8
8 changed files with 18 additions and 34 deletions
-5
View File
@@ -23,8 +23,3 @@ type instrument struct {
func (i instrument) ServeHTTP(w http.ResponseWriter, r *http.Request) {
i.next.ServeHTTP(w, r)
}
// Dummy implements the Service interface.
func (i instrument) Dummy(w http.ResponseWriter, r *http.Request) {
i.next.Dummy(w, r)
}
-5
View File
@@ -23,8 +23,3 @@ type logging struct {
func (l logging) ServeHTTP(w http.ResponseWriter, r *http.Request) {
l.next.ServeHTTP(w, r)
}
// Dummy implements the Service interface.
func (l logging) Dummy(w http.ResponseWriter, r *http.Request) {
l.next.Dummy(w, r)
}
+3 -10
View File
@@ -25,7 +25,6 @@ import (
// Service defines the extension handlers.
type Service interface {
ServeHTTP(http.ResponseWriter, *http.Request)
Dummy(http.ResponseWriter, *http.Request)
}
// NewService returns a service implementation for Service.
@@ -178,14 +177,6 @@ func (k IDP) ServeHTTP(w http.ResponseWriter, r *http.Request) {
k.mux.ServeHTTP(w, r)
}
// Dummy implements the Service interface.
func (k IDP) Dummy(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/plain")
w.WriteHeader(http.StatusOK)
w.Write([]byte(http.StatusText(http.StatusOK)))
}
// Index renders the static html with the
func (k IDP) Index() http.HandlerFunc {
@@ -211,6 +202,8 @@ func (k IDP) Index() http.HandlerFunc {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
w.Write(indexHTML)
if _, err := w.Write(indexHTML); err != nil {
k.logger.Error().Err(err).Msg("could not write to response writer")
}
})
}
-5
View File
@@ -21,8 +21,3 @@ type tracing struct {
func (t tracing) ServeHTTP(w http.ResponseWriter, r *http.Request) {
middleware.Trace(t.next).ServeHTTP(w, r)
}
// Dummy implements the Service interface.
func (t tracing) Dummy(w http.ResponseWriter, r *http.Request) {
t.next.Dummy(w, r)
}