From 7193c362c0709d860968d9c95ad09c0cc7f8c9ad Mon Sep 17 00:00:00 2001 From: bluebrown Date: Thu, 17 Oct 2024 21:32:49 +0200 Subject: [PATCH] fix: http example Remove the superfluous response.WriteHeader call. https://pkg.go.dev/net/http#ResponseWriter: > If [ResponseWriter.WriteHeader] has not yet been called, Write calls > WriteHeader(http.StatusOK) before writing the data. Signed-off-by: bluebrown --- examples/httpserver/main.go | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/httpserver/main.go b/examples/httpserver/main.go index c30749f..2977634 100644 --- a/examples/httpserver/main.go +++ b/examples/httpserver/main.go @@ -15,7 +15,6 @@ func main() { server := &http.Server{ Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Write([]byte("Hello, World!")) - w.WriteHeader(http.StatusOK) }), }