From 1889b90d674d9ba2675b42b996ed660a8c8d347b Mon Sep 17 00:00:00 2001 From: Rian Hughes Date: Fri, 12 Apr 2024 13:56:31 +0300 Subject: [PATCH] only load .env for non-mock envs (#559) Co-authored-by: rian --- account/account_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/account/account_test.go b/account/account_test.go index 9815810a..51c21e0b 100644 --- a/account/account_test.go +++ b/account/account_test.go @@ -45,8 +45,10 @@ var ( func TestMain(m *testing.M) { flag.StringVar(&testEnv, "env", "mock", "set the test environment") flag.Parse() - if err := godotenv.Load(fmt.Sprintf(".env.%s", testEnv), ".env"); err != nil { - panic(fmt.Sprint("Failed to load env for ", testEnv)) + if testEnv != "mock" { + if err := godotenv.Load(fmt.Sprintf(".env.%s", testEnv), ".env"); err != nil { + panic(fmt.Sprint("Failed to load env for ", testEnv)) + } } base = os.Getenv("INTEGRATION_BASE") if base == "" && testEnv != "mock" {