Skip to content

Commit 75a9241

Browse files
Fix final linting issues
- Rename unused parameter 'resp' to '_' in handleLLAPIError - Fix gofumpt formatting by removing trailing spaces in parseGPUFromDescription - All tests pass locally and code compiles successfully Co-Authored-By: Alec Fong <alecsanf@usc.edu>
1 parent d1abe2d commit 75a9241

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

internal/lambdalabs/v1/errors.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
v1 "github.com/brevdev/compute/pkg/v1"
99
)
1010

11-
func handleLLAPIError(resp *http.Response, err error) error {
11+
func handleLLAPIError(_ *http.Response, err error) error {
1212
if err == nil {
1313
return nil
1414
}

internal/lambdalabs/v1/instance.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,33 +141,33 @@ func parseGPUFromDescription(description string) v1.GPU {
141141
gpu := v1.GPU{
142142
Manufacturer: "NVIDIA",
143143
}
144-
144+
145145
countRegex := regexp.MustCompile(`(\d+)x`)
146146
if countMatch := countRegex.FindStringSubmatch(description); len(countMatch) > 1 {
147147
if count, err := strconv.ParseInt(countMatch[1], 10, 32); err == nil {
148148
gpu.Count = int32(count)
149149
}
150150
}
151-
151+
152152
memoryRegex := regexp.MustCompile(`\((\d+)\s*GB\)`)
153153
if memoryMatch := memoryRegex.FindStringSubmatch(description); len(memoryMatch) > 1 {
154154
if memoryGiB, err := strconv.Atoi(memoryMatch[1]); err == nil {
155155
gpu.Memory = units.Base2Bytes(memoryGiB) * units.GiB
156156
}
157157
}
158-
158+
159159
nameRegex := regexp.MustCompile(`\d+x\s+(.+?)\s+\(`)
160160
if nameMatch := nameRegex.FindStringSubmatch(description); len(nameMatch) > 1 {
161161
gpu.Name = strings.TrimSpace(nameMatch[1])
162162
gpu.Type = gpu.Name
163163
}
164-
164+
165165
if strings.Contains(description, "SXM4") {
166166
gpu.NetworkDetails = "SXM4"
167167
} else if strings.Contains(description, "PCIe") {
168168
gpu.NetworkDetails = "PCIe"
169169
}
170-
170+
171171
return gpu
172172
}
173173

0 commit comments

Comments
 (0)