Skip to content

Commit

Permalink
fix: cleanup unused code (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
kindermoumoute authored Oct 17, 2019
1 parent e4a1a91 commit 281dd22
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 36 deletions.
4 changes: 0 additions & 4 deletions scw/client_option.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
24 changes: 0 additions & 24 deletions scw/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
8 changes: 0 additions & 8 deletions scw/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 281dd22

Please sign in to comment.