From 250b08cb782af595eb26dd96504f5db75f039b64 Mon Sep 17 00:00:00 2001 From: Francisco Date: Sun, 22 Jul 2018 12:27:18 -0400 Subject: [PATCH] Update server.go As a beginner many, including myself, my use this hello world sample as a starting point to learn and test. However c.String can't be used for much more, at lest for a beginner, than to just do a simple test. Once I started to add lines the rendering was all off. It took me 2 days to find/figure out I had to use c.HTML instead of c.String to output HTML pages. So, perhaps, may be bet to have c.HTML in the hello world instead as to make it easier for newcomers to use the code as a starting point. --- cookbook/hello-world/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/hello-world/server.go b/cookbook/hello-world/server.go index 06e0718b..320b4083 100644 --- a/cookbook/hello-world/server.go +++ b/cookbook/hello-world/server.go @@ -17,7 +17,7 @@ func main() { // Route => handler e.GET("/", func(c echo.Context) error { - return c.String(http.StatusOK, "Hello, World!\n") + return c.HTML(http.StatusOK, "Hello, World!\n") }) // Start server