DEV Community

Discussion on: Write a Simple REST API in Golang

Collapse
 
euantorano profile image
Info Comment hidden by post author - thread only visible in this permalink
Euan T • Edited

Nice thorough guide, but it might be worth mentioning that the recommended practice is to use a custom http.Server with timeouts and such, as described here.

Another useful thing to perhaps mention is using the request context when running DB queries in order to handling timing them out and cancelling them. Contexts are also useful to pass context from middleware to handlers too :)

Collapse
 
lucasnevespereira profile image
Info Comment hidden by post author - thread only visible in this permalink
Lucas Neves Pereira

Thanks, I appreciate your feedback :)

Some comments have been hidden by the post's author - find out more