Intern
Is it standard practice to place the auth.go file and the auth_test.go test in the same directory?
sobes.tech AI
Answer from AI
Yes, this is a normal and common practice in Go. Usually, source files and their corresponding tests are placed in the same directory so that tests have access to unexported functions and structures of the package.
For example, if you have a file auth.go with an implementation, then auth_test.go in the same folder allows you to write tests that directly check the internals of the package.
This simplifies code and test organization, and also aligns with Go standards and recommendations.