Skip to content

Commit

Permalink
Merge pull request #386 from tri-adam/golangci-lint-v1.61
Browse files Browse the repository at this point in the history
ci: bump golangci-lint to v1.61
  • Loading branch information
tri-adam authored Sep 27, 2024
2 parents a270847 + 0d09c53 commit d08b6c1
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 12 deletions.
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

0 comments on commit d08b6c1

Please sign in to comment.