From d04391574b4f220cd73fa13584357d83d17b360e Mon Sep 17 00:00:00 2001 From: Atze de Vries Date: Thu, 14 Nov 2024 10:35:42 +0100 Subject: [PATCH] rename setConnectionType to determineConnectionType --- boostrap_test.go | 6 +++--- bootstrap.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/boostrap_test.go b/boostrap_test.go index 84e92588..250995d3 100644 --- a/boostrap_test.go +++ b/boostrap_test.go @@ -39,18 +39,18 @@ func TestSetConnectionType(t *testing.T) { } // If not auto it should just pass through - connectionType, err := setConnectionType(ddCfg, ConnectionTypeSocket) + connectionType, err := determineConnectionType(ddCfg, ConnectionTypeSocket) assert.NoError(t, err) assert.Equal(t, ConnectionTypeSocket, connectionType) // Auto should detect - connectionType, err = setConnectionType(ddCfg, ConnectionTypeAuto) + connectionType, err = determineConnectionType(ddCfg, ConnectionTypeAuto) assert.NoError(t, err) assert.Equal(t, ConnectionTypeHTTP, connectionType) // Fail on unable to detect when auto ddCfg.APM = "tmp" - connectionType, err = setConnectionType(ddCfg, ConnectionTypeAuto) + connectionType, err = determineConnectionType(ddCfg, ConnectionTypeAuto) assert.Error(t, err) assert.Equal(t, ConnectionTypeAuto, connectionType) } diff --git a/bootstrap.go b/bootstrap.go index e7320e1f..ffaf08ec 100644 --- a/bootstrap.go +++ b/bootstrap.go @@ -50,7 +50,7 @@ func StartDatadog(cfg config.DatadogParameters, connectionType ConnectionType) e compareConfigWithEnv(cfg) - connectionType, err = setConnectionType(cfg, connectionType) + connectionType, err = determineConnectionType(cfg, connectionType) if err != nil { return err } @@ -106,7 +106,7 @@ func GracefulDatadogShutdown() { defer profiler.Stop() } -func setConnectionType(cfg config.DatadogParameters, connectionType ConnectionType) (ConnectionType, error) { +func determineConnectionType(cfg config.DatadogParameters, connectionType ConnectionType) (ConnectionType, error) { switch connectionType { case ConnectionTypeSocket: return connectionType, nil