From 797e653da60e4619dcb0ae703714147b5a7454c6 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 25 Jan 2019 11:41:49 +0000 Subject: [PATCH] Call WriteHeader after setting other header(s) in the example (#442) From the docs: Changing the header map after a call to WriteHeader (or Write) has no effect unless the modified headers are trailers. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9e99a270..c661599a 100644 --- a/README.md +++ b/README.md @@ -503,8 +503,8 @@ package main func HealthCheckHandler(w http.ResponseWriter, r *http.Request) { // A very simple health check. - w.WriteHeader(http.StatusOK) w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) // In the future we could report back on the status of our DB, or our cache // (e.g. Redis) by performing a simple PING, and include them in the response.