Revert "fix code smells"

This reverts commit a22342ea28.
This commit is contained in:
A.Unger
2021-11-15 10:16:20 +01:00
parent a22342ea28
commit 2b0f414b46
3 changed files with 28 additions and 32 deletions
+3 -5
View File
@@ -27,12 +27,10 @@ func Server(opts ...Option) (*http.Server, error) {
), nil
}
const contentTypeHeader = "Content-Type"
// health implements the health check.
func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
w.Header().Set(contentTypeHeader, "text/plain")
w.Header().Set("Content-Type", "text/plain")
w.WriteHeader(http.StatusOK)
// TODO(tboerger): check if services are up and running
@@ -46,7 +44,7 @@ func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) {
// ready implements the ready check.
func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
w.Header().Set(contentTypeHeader, "text/plain")
w.Header().Set("Content-Type", "text/plain")
w.WriteHeader(http.StatusOK)
// TODO(tboerger): check if services are up and running
@@ -60,7 +58,7 @@ func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) {
// configDump implements the config dump
func configDump(cfg *config.Config) func(http.ResponseWriter, *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
w.Header().Set(contentTypeHeader, "application/json")
w.Header().Set("Content-Type", "application/json")
b, err := json.Marshal(cfg)
if err != nil {