Skip to content

Commit c0a7c7b

Browse files
committed
chore: add support for unused
1 parent af80d74 commit c0a7c7b

File tree

3 files changed

+1
-27
lines changed

3 files changed

+1
-27
lines changed

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ linters:
2222
- gofumpt # Gofumpt checks whether code was gofumpt-ed. [fast: true, auto-fix: true]
2323
- goimports # In addition to fixing imports, goimports also formats your code in the same style as gofmt. [fast: true, auto-fix: true]
2424
- mirror # reports wrong mirror patterns of bytes/strings usage [fast: false, auto-fix: false]
25+
- unused #(megacheck): Checks Go code for unused constants, variables, functions and types [fast: false, auto-fix: false]
2526
- whitespace # Tool for detection of leading and trailing whitespace [fast: true, auto-fix: true]
2627

2728
issues:

api/instance/v1/instance_utils.go

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -103,28 +103,6 @@ type AttachVolumeResponse struct {
103103
Server *Server `json:"-"`
104104
}
105105

106-
// volumesToVolumeTemplates converts a map of *Volume to a map of *VolumeTemplate
107-
// so it can be used in a UpdateServer request
108-
func volumesToVolumeTemplates(volumes map[string]*VolumeServer) map[string]*VolumeServerTemplate {
109-
volumeTemplates := map[string]*VolumeServerTemplate{}
110-
for key, volume := range volumes {
111-
volumeTemplate := &VolumeServerTemplate{
112-
ID: &volume.ID,
113-
}
114-
115-
if volume.Name != "" {
116-
volumeTemplate.Name = &volume.Name
117-
}
118-
119-
if volume.VolumeType == VolumeServerVolumeTypeSbsVolume {
120-
volumeTemplate.VolumeType = VolumeVolumeTypeSbsVolume
121-
}
122-
123-
volumeTemplates[key] = volumeTemplate
124-
}
125-
return volumeTemplates
126-
}
127-
128106
// AttachVolume attaches a volume to a server
129107
//
130108
// Note: Implementation is thread-safe.

scw/path.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,3 @@ func GetScwConfigDir() (string, error) {
8080
}
8181
return filepath.Join(homeDir, ".config", "scw"), nil
8282
}
83-
84-
func fileExist(name string) bool {
85-
_, err := os.Stat(name)
86-
return err == nil
87-
}

0 commit comments

Comments
 (0)