From 06a172dfbdc33fe1a90dd0f46f9ed3b5677560da Mon Sep 17 00:00:00 2001 From: dustinturp84 Date: Mon, 29 Dec 2025 12:24:17 -0600 Subject: [PATCH] updated env name to not conflict with existing --- client/client.go | 2 +- client/client_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/client.go b/client/client.go index a051d97..52a014f 100644 --- a/client/client.go +++ b/client/client.go @@ -22,7 +22,7 @@ type Client struct { func New(apiKey, version string) *Client { baseURL := "https://customer.cloudamqp.com/api" - if envURL := os.Getenv("CLOUDAMQP_URL"); envURL != "" { + if envURL := os.Getenv("CLOUDAMQP_API_URL"); envURL != "" { baseURL = envURL } return &Client{ diff --git a/client/client_test.go b/client/client_test.go index b752e53..5ebea49 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -21,12 +21,12 @@ func TestNew(t *testing.T) { func TestNew_WithEnvironmentVariable(t *testing.T) { // Save original environment variable - originalURL := os.Getenv("CLOUDAMQP_URL") - defer os.Setenv("CLOUDAMQP_URL", originalURL) + originalURL := os.Getenv("CLOUDAMQP_API_URL") + defer os.Setenv("CLOUDAMQP_API_URL", originalURL) // Test with custom base URL from environment variable customURL := "https://custom.example.com/api" - os.Setenv("CLOUDAMQP_URL", customURL) + os.Setenv("CLOUDAMQP_API_URL", customURL) apiKey := "test-api-key" client := New(apiKey, "test") @@ -37,7 +37,7 @@ func TestNew_WithEnvironmentVariable(t *testing.T) { assert.NotNil(t, client.httpClient) // Test with empty environment variable (should use default) - os.Setenv("CLOUDAMQP_URL", "") + os.Setenv("CLOUDAMQP_API_URL", "") client = New(apiKey, "test") assert.NotNil(t, client)