At the moment, I try to create a small Web-Project using Go for data handling on the server.
I try to pass my database-connection to my HandlerFunc(tions) but it does no
You can always have "env" defined as global variable.
But before everyone will hate me, this is not a good solution! You should create a package that encapsulate the access to your database with public function that state your exact intent.
Something along the lines of
Package db
var config ....
func ShowTodos(params ... ) result {
your database access code here....
}
and from your router function access it with
db.ShowTodos(...)