Different Ways to Pass Database Connection into Controllers in Golang
![how-to-pass-db-connection-to-controllers-in-go-lang](https://techinscribed.com/wp-content/uploads/2020/01/how-to-pass-db-connection-to-controllers-in-go-lang-2.png)
In Golang, one can pass the database connection to the controller as a global variable or by creating a separate struct or by creating a repository interface and passing it to the controller.