diff --git a/.golangci.yml b/.golangci.yml index 9b00ff7ac..b28ac1c55 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -18,6 +18,7 @@ linters: - gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification [fast: true, auto-fix: true] - gofumpt # Gofumpt checks whether code was gofumpt-ed. [fast: true, auto-fix: true] - goimports # In addition to fixing imports, goimports also formats your code in the same style as gofmt. [fast: true, auto-fix: true] + - unused #(megacheck): Checks Go code for unused constants, variables, functions and types [fast: false, auto-fix: false] - whitespace # Tool for detection of leading and trailing whitespace [fast: true, auto-fix: true] issues: diff --git a/api/instance/v1/instance_utils.go b/api/instance/v1/instance_utils.go index 501f85979..e38b769f4 100644 --- a/api/instance/v1/instance_utils.go +++ b/api/instance/v1/instance_utils.go @@ -103,28 +103,6 @@ type AttachVolumeResponse struct { Server *Server `json:"-"` } -// volumesToVolumeTemplates converts a map of *Volume to a map of *VolumeTemplate -// so it can be used in a UpdateServer request -func volumesToVolumeTemplates(volumes map[string]*VolumeServer) map[string]*VolumeServerTemplate { - volumeTemplates := map[string]*VolumeServerTemplate{} - for key, volume := range volumes { - volumeTemplate := &VolumeServerTemplate{ - ID: &volume.ID, - } - - if volume.Name != "" { - volumeTemplate.Name = &volume.Name - } - - if volume.VolumeType == VolumeServerVolumeTypeSbsVolume { - volumeTemplate.VolumeType = VolumeVolumeTypeSbsVolume - } - - volumeTemplates[key] = volumeTemplate - } - return volumeTemplates -} - // AttachVolume attaches a volume to a server // // Note: Implementation is thread-safe. diff --git a/scw/path.go b/scw/path.go index 71e153e0c..a4e7a5f9c 100644 --- a/scw/path.go +++ b/scw/path.go @@ -80,8 +80,3 @@ func GetScwConfigDir() (string, error) { } return filepath.Join(homeDir, ".config", "scw"), nil } - -func fileExist(name string) bool { - _, err := os.Stat(name) - return err == nil -}