echox icon indicating copy to clipboard operation
echox copied to clipboard

Update server.go

Open francisco1844 opened this issue 6 years ago • 2 comments

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.

francisco1844 avatar Jul 22 '18 16:07 francisco1844

I'd prefer to keep minimal examples as simple as possible, so just using a String seems ok to me for that purpose. It might be better to point to the Rendering docs to help beginners.

But feedback is welcome here.

lammel avatar Dec 06 '20 15:12 lammel

I agree with @lammel, in fact someone else could choose c.JSON instead of c.HTML, which is more common for APIs

pafuent avatar Dec 11 '20 03:12 pafuent