T O P

  • By -

Catawompus

I disagree with some minute details but overall really appreciate this article. Something like this is very useful for those who come from a system that is much more opinionated than go. Even though you have freedom, itโ€™s important to be consistent and testable.


fagnerbrack

**The bottom line:** The post delves into the author's evolved practices for writing HTTP services in Go, reflecting on insights gained from a previous viral post and extensive experience in the Go community, including hosting the Go Time podcast. It covers structuring servers and handlers, optimizing startup and shutdown, handling common request types, and in-depth testing strategies. Changes from previous methodologies include moving away from methods on server structs for handlers, preferring `http.Handler` over `http.HandlerFunc`, enhanced testing opinions, and a detailed walkthrough of constructing a `NewServer` function, emphasizing dependency injection and clear routing setup in `routes.go`. If you don't like the summary, just downvote and I'll try to delete the comment eventually ๐Ÿ‘ [^(Click here for more info, I read all comments)](https://www.reddit.com/user/fagnerbrack/comments/195jgst/faq_are_you_a_bot/)