Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/prebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
GO_VERSION: '1.22.11'
GOLANGCI_LINT_VERSION: '1.61.0'
GOLANGCI_LINT_VERSION: '1.63.4'

jobs:
check:
Expand Down
10 changes: 5 additions & 5 deletions fs/remote/blob_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,17 +463,17 @@ func multiRoundTripper(t *testing.T, contents []byte, opts ...interface{}) Round
})
var sparse bool
if sorted[0].b == 0 {
var max int64
var maxRegionEnd int64
for _, reg := range sorted {
if reg.e > max {
if max < reg.b-1 {
if reg.e > maxRegionEnd {
if maxRegionEnd < reg.b-1 {
sparse = true
break
}
max = reg.e
maxRegionEnd = reg.e
}
}
if max >= int64(len(contents)-1) && !sparse {
if maxRegionEnd >= int64(len(contents)-1) && !sparse {
t.Logf("serving whole range %q = %d", ranges, len(contents))
header := make(http.Header)
header.Add("Content-Length", fmt.Sprintf("%d", len(contents)))
Expand Down
7 changes: 0 additions & 7 deletions fs/span-manager/span_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,13 +362,6 @@ func TestSpanManagerRetries(t *testing.T) {
t.Fatalf("unexpected err; expected %v, got %v", tc.expectedErr, err)
}

min := func(x, y int) int {
if x < y {
return x
}
return y
}

if rdr.errCount != min(tc.spanManagerRetries+1, tc.readerErrors) {
t.Fatalf("retry count is unexpected; expected %d, got %d", min(tc.spanManagerRetries+1, tc.readerErrors), rdr.errCount)
}
Expand Down
12 changes: 6 additions & 6 deletions metadata/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ func hasDirChildren(name string, children ...string) check {
}
}

func hasChardev(name string, maj, min int) check {
func hasChardev(name string, major, minor int) check {
return func(t *testing.T, r testableReader) {
id, err := lookup(r, name)
if err != nil {
Expand All @@ -364,14 +364,14 @@ func hasChardev(name string, maj, min int) check {
t.Errorf("file %q is not a chardev: %v", name, attr.Mode)
return
}
if attr.DevMajor != maj || attr.DevMinor != min {
t.Errorf("unexpected major/minor of chardev %q: %d/%d want %d/%d", name, attr.DevMajor, attr.DevMinor, maj, min)
if attr.DevMajor != major || attr.DevMinor != minor {
t.Errorf("unexpected major/minor of chardev %q: %d/%d want %d/%d", name, attr.DevMajor, attr.DevMinor, major, minor)
return
}
}
}

func hasBlockdev(name string, maj, min int) check {
func hasBlockdev(name string, major, minor int) check {
return func(t *testing.T, r testableReader) {
id, err := lookup(r, name)
if err != nil {
Expand All @@ -387,8 +387,8 @@ func hasBlockdev(name string, maj, min int) check {
t.Errorf("file %q is not a blockdev: %v", name, attr.Mode)
return
}
if attr.DevMajor != maj || attr.DevMinor != min {
t.Errorf("unexpected major/minor of blockdev %q: %d/%d want %d/%d", name, attr.DevMajor, attr.DevMinor, maj, min)
if attr.DevMajor != major || attr.DevMinor != minor {
t.Errorf("unexpected major/minor of blockdev %q: %d/%d want %d/%d", name, attr.DevMajor, attr.DevMinor, major, minor)
return
}
}
Expand Down
4 changes: 2 additions & 2 deletions service/keychain/kubeconfig/kubeconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ func (kc *keychain) startSyncSecrets(ctx context.Context, client kubernetes.Inte
queue.Add(key)
}
},
UpdateFunc: func(old, new interface{}) {
key, err := cache.MetaNamespaceKeyFunc(new)
UpdateFunc: func(oldObj, newObj interface{}) {
key, err := cache.MetaNamespaceKeyFunc(newObj)
if err == nil {
queue.Add(key)
}
Expand Down
4 changes: 2 additions & 2 deletions service/resolver/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ func jitter(duration time.Duration, divisor int64) time.Duration {
// overwhelming the repository when it comes back online
// DefaultBackoff either tries to parse the 'Retry-After' header of the response; or, it uses an
// exponential backoff 2 ^ numAttempts, limited by max
func backoffStrategy(min, max time.Duration, attemptNum int, resp *http.Response) time.Duration {
delayTime := rhttp.DefaultBackoff(min, max, attemptNum, resp)
func backoffStrategy(minDuration, maxDuration time.Duration, attemptNum int, resp *http.Response) time.Duration {
delayTime := rhttp.DefaultBackoff(minDuration, maxDuration, attemptNum, resp)
return jitter(delayTime, 8)
}

Expand Down