Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
joshjennings98 committed Sep 18, 2024
1 parent dcb4b08 commit a928a83
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions utils/field/fields_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestOptionalField(t *testing.T) {
},
{
fieldType: "UInt",
value: uint(time.Now().Second()),
value: uint(time.Now().Second()), //nolint:gosec // time is positive and uint has more bits than int so no overflow
defaultValue: uint(76),
setFunction: func(a any) any {
return ToOptionalUint(a.(uint))
Expand Down Expand Up @@ -97,7 +97,7 @@ func TestOptionalField(t *testing.T) {
},
{
fieldType: "UInt64",
value: uint64(time.Now().Unix()),
value: uint64(time.Now().Unix()), //nolint:gosec // time is positive and uint64 has more bits than int64 so no overflow
defaultValue: uint64(97894),
setFunction: func(a any) any {
return ToOptionalUint64(a.(uint64))
Expand Down
4 changes: 2 additions & 2 deletions utils/filesystem/zip.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,10 @@ func (fs *VFS) unzip(ctx context.Context, source string, destination string, lim
fileCounter.Inc()
fileList = append(fileList, filePath)
}
totalSizeOnDisk.Add(uint64(fileSizeOnDisk))
totalSizeOnDisk.Add(uint64(fileSizeOnDisk)) //nolint:gosec // file size is positive and uint64 has more bits than int64 so no overflow
}
} else {
totalSizeOnDisk.Add(uint64(fileSizeOnDisk))
totalSizeOnDisk.Add(uint64(fileSizeOnDisk)) //nolint:gosec // file size is positive and uint64 has more bits than int64 so no overflow
}

if limits.Apply() && totalSizeOnDisk.Load() > limits.GetMaxTotalSize() {
Expand Down
2 changes: 1 addition & 1 deletion utils/retry/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func RetryIf(ctx context.Context, logger logr.Logger, retryPolicy *RetryPolicyCo
retry.MaxDelay(retryPolicy.RetryWaitMax),
retry.MaxJitter(25*time.Millisecond),
retry.DelayType(retryType),
retry.Attempts(uint(retryPolicy.RetryMax)),
retry.Attempts(uint(retryPolicy.RetryMax)), //nolint:gosec // in normal use this will have had Validate() called which enforces that the minimum number of RetryMax is 0 so it won't overflow
retry.RetryIf(retryConditionFn),
retry.LastErrorOnly(true),
retry.Context(ctx),
Expand Down

0 comments on commit a928a83

Please sign in to comment.