From 281dd2237f297205cad5e357bdcb38d1ce26459d Mon Sep 17 00:00:00 2001 From: Olivier Cano Date: Thu, 17 Oct 2019 15:12:25 +0200 Subject: [PATCH] fix: cleanup unused code (#217) --- scw/client_option.go | 4 ---- scw/client_test.go | 24 ------------------------ scw/path.go | 8 -------- 3 files changed, 36 deletions(-) diff --git a/scw/client_option.go b/scw/client_option.go index 6924b39ca..e10ec59c8 100644 --- a/scw/client_option.go +++ b/scw/client_option.go @@ -195,9 +195,5 @@ func (s *settings) validate() error { return errors.New("default zone cannot be empty") } - if s.defaultPageSize != nil && *s.defaultPageSize <= 0 { - return errors.New("default page size cannot be <= 0") - } - return nil } diff --git a/scw/client_test.go b/scw/client_test.go index 285900708..b041268b9 100644 --- a/scw/client_test.go +++ b/scw/client_test.go @@ -39,30 +39,6 @@ func TestNewClientWithDefaults(t *testing.T) { } -type mockConfig struct{} - -func (c *mockConfig) GetAccessKey() (string, bool) { - return testAccessKey, true -} -func (c *mockConfig) GetSecretKey() (string, bool) { - return testSecretKey, true -} -func (c *mockConfig) GetAPIURL() (string, bool) { - return testAPIURL, true -} -func (c *mockConfig) GetInsecure() (bool, bool) { - return testInsecure, true -} -func (c *mockConfig) GetDefaultOrganizationID() (string, bool) { - return testDefaultOrganizationID, true -} -func (c *mockConfig) GetDefaultRegion() (Region, bool) { - return testDefaultRegion, true -} -func (c *mockConfig) GetDefaultZone() (Zone, bool) { - return testDefaultZone, true -} - func TestNewClientWithOptions(t *testing.T) { t.Run("Basic", func(t *testing.T) { diff --git a/scw/path.go b/scw/path.go index 37e95d4a4..f7b0b48ce 100644 --- a/scw/path.go +++ b/scw/path.go @@ -19,14 +19,6 @@ var ( ErrNoHomeDir = errors.New("user home directory not found") ) -func inConfigFile() string { - v2path, exist := getConfigV2FilePath() - if exist { - return "in config file " + v2path - } - return "" -} - // GetConfigPath returns the default path. // Default path is base on the following priority order: // - $SCW_CONFIG_PATH