Skip to content

Commit

Permalink
Put os.Getenv calls in variable block
Browse files Browse the repository at this point in the history
  • Loading branch information
omarjatoi committed May 18, 2024
1 parent 3f2becf commit be9ffd7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,15 @@ import (
)

var (
apiAccessToken = ""
zone = ""
apiAccessToken = os.Getenv("TEST_API_ACCESS_TOKEN")
zone = os.Getenv("TEST_ZONE")
apiUrl = "https://api.sandbox.dnsimple.com"
ttl = time.Duration(1 * time.Hour)
)

type testRecordsCleanup = func()

func TestMain(m *testing.M) {
apiAccessToken = os.Getenv("TEST_API_ACCESS_TOKEN")
zone = os.Getenv("TEST_ZONE")

if len(apiAccessToken) == 0 || len(zone) == 0 {
panic("API Access Token, Zone, and Account ID must be set using environment variables")
}
Expand Down

0 comments on commit be9ffd7

Please sign in to comment.