Relative Content

Tag Archive for gotestingclean-architecture

Does golang unit test also running main function?

I have simple learning clean architecture app written in golang. I wanna add test to my service package. I put the test file under service_test package. When i running my test, it always show error cannot found storage/log. I realize it just the place where i put my logging file to contain all my logging in one place. The test cannot find the file because it run in different root from project root. My question is : Is this the default behavior of golang test package? Does go test also running main function?