package middleware import ( "os" "testing" ) // TestMain runs before all tests and sets up the test environment func TestMain(m *testing.M) { // Set GO_ENV for all tests to prevent init() failures os.Setenv("GO_ENV", "development") // Run tests code := m.Run() // Cleanup os.Unsetenv("GO_ENV") os.Exit(code) }