Accessing your database from inside an HTTP handler in Go
Note: While this is interesting to learn more about creating closures, it was pointed out to me that there is a better way to do this. Look at this next post to learn more about it. Writing my last project backend in Go, I was confronted with how to actually write my HTTP handlers. The main issue I encountered was how to get the database handle in the handler so that I could actually use it for incoming requests. Since you usually have to respect a given interface, you cannot just add new arguments to the handling function. ...