Skip to content

Commit 05a679d

Browse files
Fix remaining linting issues for CI
- Remove unused handleLLAPIError function and net/http import from errors.go - Fix indentation of inner for loop in instancetype.go line 43 - Remove extra blank lines before const and function declarations (lines 104, 151) - All tests pass locally and code compiles successfully Co-Authored-By: Alec Fong <[email protected]>
1 parent 75a9241 commit 05a679d

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

internal/lambdalabs/v1/errors.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,11 @@ package v1
22

33
import (
44
"fmt"
5-
"net/http"
65
"strings"
76

87
v1 "github.com/brevdev/compute/pkg/v1"
98
)
109

11-
func handleLLAPIError(_ *http.Response, err error) error {
12-
if err == nil {
13-
return nil
14-
}
15-
16-
return handleLLErrToCloudErr(err)
17-
}
18-
1910
func handleLLErrToCloudErr(err error) error {
2011
if err == nil {
2112
return nil

internal/lambdalabs/v1/instancetype.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func (c *LambdaLabsClient) GetInstanceTypes(ctx context.Context, args v1.GetInst
4040
availableRegions[region.Name] = true
4141
}
4242

43-
for _, region := range instanceTypeData.RegionsWithCapacityAvailable {
43+
for _, region := range instanceTypeData.RegionsWithCapacityAvailable {
4444
if len(args.Locations) > 0 && !args.Locations.IsAll() && !containsLocation(args.Locations, region.Name) {
4545
continue
4646
}
@@ -101,7 +101,6 @@ func convertLambdaLabsInstanceTypeToV1InstanceType(location string, llInstanceTy
101101
return instanceType, nil
102102
}
103103

104-
105104
const lambdaLocationsData = `[
106105
{"location_name": "us-west-1", "description": "California, USA", "country": "USA"},
107106
{"location_name": "us-west-2", "description": "Arizona, USA", "country": "USA"},
@@ -148,7 +147,6 @@ func (c *LambdaLabsClient) GetLocations(_ context.Context, _ v1.GetLocationsArgs
148147
return locations, nil
149148
}
150149

151-
152150
func contains(slice []string, item string) bool {
153151
for _, s := range slice {
154152
if s == item {

0 commit comments

Comments
 (0)