Skip to content

Commit b5776f9

Browse files
authored
Fix new golangci-lint errors (google#2105)
1 parent f07b9cb commit b5776f9

File tree

5 files changed

+9
-17
lines changed

5 files changed

+9
-17
lines changed

github/orgs_packages_test.go

-2
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ func TestOrganizationsService_PackageDeleteVersion(t *testing.T) {
377377

378378
testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
379379
return client.Organizations.PackageDeleteVersion(ctx, "", "", "", 45763)
380-
381380
})
382381
}
383382

@@ -403,6 +402,5 @@ func TestOrganizationsService_PackageRestoreVersion(t *testing.T) {
403402

404403
testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
405404
return client.Organizations.PackageRestoreVersion(ctx, "", "", "", 45763)
406-
407405
})
408406
}

github/users_packages_test.go

-4
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,6 @@ func TestUsersService_Authenticated_PackageDeleteVersion(t *testing.T) {
622622

623623
testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
624624
return client.Users.PackageDeleteVersion(ctx, "", "", "", 45763)
625-
626625
})
627626
}
628627

@@ -648,7 +647,6 @@ func TestUsersService_specifiedUser_PackageDeleteVersion(t *testing.T) {
648647

649648
testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
650649
return client.Users.PackageDeleteVersion(ctx, "", "", "", 45763)
651-
652650
})
653651
}
654652

@@ -674,7 +672,6 @@ func TestUsersService_Authenticated_PackageRestoreVersion(t *testing.T) {
674672

675673
testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
676674
return client.Users.PackageRestoreVersion(ctx, "", "", "", 45763)
677-
678675
})
679676
}
680677

@@ -700,6 +697,5 @@ func TestUsersService_specifiedUser_PackageRestoreVersion(t *testing.T) {
700697

701698
testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
702699
return client.Users.PackageRestoreVersion(ctx, "", "", "", 45763)
703-
704700
})
705701
}

scrape/apps_test.go

-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ func Test_AppRestrictionsEnabled(t *testing.T) {
4343
if want := tt.want; got != want {
4444
t.Errorf("AppRestrictionsEnabled returned %t, want %t", got, want)
4545
}
46-
4746
})
4847
}
4948
}
@@ -83,7 +82,6 @@ func Test_ListOAuthApps(t *testing.T) {
8382
if !cmp.Equal(got, want) {
8483
t.Errorf("ListOAuthApps(o) returned %v, want %v", got, want)
8584
}
86-
8785
}
8886

8987
func Test_CreateApp(t *testing.T) {

update-urls/main.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,10 @@ func validateRewriteURLs(usedHelpers usedHelpersMap, endpointsByFilename endpoin
199199
path = strings.ReplaceAll(path, "%s", "%v")
200200

201201
// Check the overrides.
202-
endpoint.checkHttpMethodOverride(path)
202+
endpoint.checkHTTPMethodOverride(path)
203203

204204
methodAndPath := fmt.Sprintf("%v %v", endpoint.httpMethod, path)
205-
url, ok := docCache.UrlByMethodAndPath(methodAndPath)
205+
url, ok := docCache.URLByMethodAndPath(methodAndPath)
206206
if !ok {
207207
if i := len(endpoint.endpointComments); i > 0 {
208208
pos := fileRewriter.Position(endpoint.endpointComments[i-1].Pos())
@@ -529,7 +529,7 @@ func resolveHelpersAndCacheDocs(endpoints endpointsMap, docCache documentCacheWr
529529
}
530530

531531
type documentCacheReader interface {
532-
UrlByMethodAndPath(string) (string, bool)
532+
URLByMethodAndPath(string) (string, bool)
533533
}
534534

535535
type documentCacheWriter interface {
@@ -542,7 +542,7 @@ type documentCache struct {
542542
urlByMethodAndPath map[string]string
543543
}
544544

545-
func (dc *documentCache) UrlByMethodAndPath(methodAndPath string) (string, bool) {
545+
func (dc *documentCache) URLByMethodAndPath(methodAndPath string) (string, bool) {
546546
url, ok := dc.urlByMethodAndPath[methodAndPath]
547547
return url, ok
548548
}
@@ -657,7 +657,7 @@ func (e *Endpoint) String() string {
657657
return b.String()
658658
}
659659

660-
func (e *Endpoint) checkHttpMethodOverride(path string) {
660+
func (e *Endpoint) checkHTTPMethodOverride(path string) {
661661
lookupOverride := fmt.Sprintf("%v.%v: %v %v", e.serviceName, e.endpointName, e.httpMethod, path)
662662
logf("Looking up override for %q", lookupOverride)
663663
if v, ok := methodOverrides[lookupOverride]; ok {
@@ -747,7 +747,7 @@ func processAST(filename string, f *ast.File, services servicesMap, endpoints en
747747
stdRefLines: stdRefLines,
748748
endpointComments: endpointComments,
749749
}
750-
// ep.checkHttpMethodOverride("")
750+
// ep.checkHTTPMethodOverride("")
751751
endpoints[fullName] = ep
752752
logf("endpoints[%q] = %#v", fullName, endpoints[fullName])
753753
if ep.httpMethod == "" && (ep.helperMethod == "" || len(ep.urlFormats) == 0) {

update-urls/main_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -233,21 +233,21 @@ type fakeDocCache struct {
233233
endpoints endpointsByFragmentID
234234
}
235235

236-
func (f *fakeDocCache) UrlByMethodAndPath(methodAndPath string) (string, bool) {
236+
func (f *fakeDocCache) URLByMethodAndPath(methodAndPath string) (string, bool) {
237237
f.t.Helper()
238238
for fragmentID, endpoints := range f.endpoints {
239239
for _, endpoint := range endpoints {
240240
for _, urlFormat := range endpoint.urlFormats {
241241
key := fmt.Sprintf("%v %v", endpoint.httpMethod, urlFormat)
242242
if key == methodAndPath {
243243
url := fmt.Sprintf("%v#%v", f.baseURL, fragmentID)
244-
// log.Printf("UrlByMethodAndPath(%q) = (%q, true)", methodAndPath, url)
244+
// log.Printf("URLByMethodAndPath(%q) = (%q, true)", methodAndPath, url)
245245
return url, true
246246
}
247247
}
248248
}
249249
}
250-
f.t.Fatalf("fakeDocCache.UrlByMethodAndPath: unable to find method %v", methodAndPath)
250+
f.t.Fatalf("fakeDocCache.URLByMethodAndPath: unable to find method %v", methodAndPath)
251251
return "", false
252252
}
253253

0 commit comments

Comments
 (0)