Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: bump golangci-lint to v1.61 #386

Merged
merged 1 commit into from
Sep 27, 2024
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 .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ executors:
- image: node:22-slim
golangci-lint:
docker:
- image: golangci/golangci-lint:v1.60
- image: golangci/golangci-lint:v1.61
golang-previous:
docker:
- image: golang:1.22
Expand Down
12 changes: 5 additions & 7 deletions pkg/sif/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,19 @@ var errAlignmentOverflow = errors.New("integer overflow when calculating alignme

// nextAligned finds the next offset that satisfies alignment.
func nextAligned(offset int64, alignment int) (int64, error) {
align64 := uint64(alignment)
offset64 := uint64(offset)
align64 := int64(alignment)

if align64 <= 0 || offset64%align64 == 0 {
if align64 <= 0 || offset%align64 == 0 {
return offset, nil
}

offset64 += (align64 - offset64%align64)
align64 -= offset % align64

if offset64 > math.MaxInt64 {
if (math.MaxInt64 - offset) < align64 {
return 0, errAlignmentOverflow
}

//nolint:gosec // Overflow handled above.
return int64(offset64), nil
return offset + align64, nil
}

// writeDataObjectAt writes the data object described by di to ws, using time t, recording details
Expand Down
1 change: 0 additions & 1 deletion pkg/siftool/del.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ func (c *command) getDel() *cobra.Command {
return fmt.Errorf("while converting id: %w", err)
}

//nolint:gosec // ParseUint above ensures id is safe to cast to uint32.
return c.app.Del(args[1], uint32(id))
},
DisableFlagsInUseLine: true,
Expand Down
1 change: 0 additions & 1 deletion pkg/siftool/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ func (c *command) getDump() *cobra.Command {
return fmt.Errorf("while converting id: %w", err)
}

//nolint:gosec // ParseUint above ensures id is safe to cast to uint32.
return c.app.Dump(args[1], uint32(id))
},
DisableFlagsInUseLine: true,
Expand Down
1 change: 0 additions & 1 deletion pkg/siftool/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ func (c *command) getInfo() *cobra.Command {
return fmt.Errorf("while converting id: %w", err)
}

//nolint:gosec // ParseUint above ensures id is safe to cast to uint32.
return c.app.Info(args[1], uint32(id))
},
DisableFlagsInUseLine: true,
Expand Down
1 change: 0 additions & 1 deletion pkg/siftool/setprim.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ func (c *command) getSetPrim() *cobra.Command {
return fmt.Errorf("while converting id: %w", err)
}

//nolint:gosec // ParseUint above ensures id is safe to cast to uint32.
return c.app.Setprim(args[1], uint32(id))
},
DisableFlagsInUseLine: true,
Expand Down