Go Series: Learning How to Build a Web Service Using Go from Scratch Pt. 15 — Putting It Together

Jonathan Chao
3 min readJul 18, 2023

Let’s put everything we’ve got together.

We create a main.go which calls…

func main() {
r := gin.Default()
db, error := tools.SetupDB() // assuming we get a function to do this and returns a *gorm.DB instance
routes.SetupRoutes(r, db) // calls route.go file to set up…

--

--

Jonathan Chao

I am a software developer who has been in this industry for close to a decade. I share my experience to people who are or want to get into the industry