Make package constants private

Signed-off-by: Andrew Keesler <akeesler@vmware.com>
This commit is contained in:
Ryan Richard 2020-07-07 13:41:05 -07:00 committed by Andrew Keesler
parent 68d01f97a4
commit ee7480bcda
2 changed files with 3 additions and 3 deletions

View File

@ -7,8 +7,8 @@ package handlers
import "net/http" import "net/http"
const JSONMimeType = "application/json; charset=utf-8" const jsonMimeType = "application/json; charset=utf-8"
const HeaderNameContentType = "Content-Type" const headerNameContentType = "Content-Type"
func New() http.Handler { func New() http.Handler {
mux := http.NewServeMux() mux := http.NewServeMux()

View File

@ -19,7 +19,7 @@ type healthzHandler struct{}
func (h healthzHandler) ServeHTTP(responseWriter http.ResponseWriter, _ *http.Request) { func (h healthzHandler) ServeHTTP(responseWriter http.ResponseWriter, _ *http.Request) {
response := healthzResponse{"OK"} response := healthzResponse{"OK"}
js, _ := json.Marshal(response) js, _ := json.Marshal(response)
responseWriter.Header().Set(HeaderNameContentType, JSONMimeType) responseWriter.Header().Set(headerNameContentType, jsonMimeType)
_, _ = responseWriter.Write(js) _, _ = responseWriter.Write(js)
} }