Skip to content

Commit

Permalink
chore: add support for unused
Browse files Browse the repository at this point in the history
  • Loading branch information
remyleone committed Aug 27, 2024
1 parent 51e122c commit d373af4
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 27 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
22 changes: 0 additions & 22 deletions api/instance/v1/instance_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 0 additions & 5 deletions scw/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit d373af4

Please sign in to comment.