diff --git a/go-api/handlers/handler.go b/go-api/handlers/handler.go index 150a676..c32c400 100644 --- a/go-api/handlers/handler.go +++ b/go-api/handlers/handler.go @@ -20,7 +20,7 @@ type SuccessResponse struct { func Handler(w http.ResponseWriter, r *http.Request) { log.Println("Running handler...") - code := utils.GetResponseCode(r) + code := utils.GetStatusCode(r) w.WriteHeader(code) w.Header().Set("Content-Type", "application/json") diff --git a/go-api/utils/utils.go b/go-api/utils/utils.go index 7d3a449..55f48ef 100644 --- a/go-api/utils/utils.go +++ b/go-api/utils/utils.go @@ -15,13 +15,13 @@ func GetPort() string { return "8080" } -func GetResponseCode(r *http.Request) int { +func GetStatusCode(r *http.Request) int { // If the `force-fail` header is set, get and return its value. if failCode := r.Header.Get("force-fail"); failCode != "" { log.Println("`force-fail` header set...") if code, err := strconv.Atoi(failCode); err == nil { - log.Printf("Setting the response code to %d...", code) + log.Printf("Setting the status code to %d...", code) return code }