If you've been following this tutorial, you'd have the following file structure: Unit testing With unit testing we just want to verify that the tested functions work as expected in isolation, so we will mock database behavior. I like having the tests I write next to the files where the functions reside. file: internal/router/health_test.go package router_test import "testing" func TestHealth