Skip to content

Commit d08b6c1

Browse files
authored
Merge pull request #386 from tri-adam/golangci-lint-v1.61
ci: bump golangci-lint to v1.61
2 parents a270847 + 0d09c53 commit d08b6c1

File tree

6 files changed

+6
-12
lines changed

6 files changed

+6
-12
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ executors:
99
- image: node:22-slim
1010
golangci-lint:
1111
docker:
12-
- image: golangci/golangci-lint:v1.60
12+
- image: golangci/golangci-lint:v1.61
1313
golang-previous:
1414
docker:
1515
- image: golang:1.22

pkg/sif/create.go

+5-7
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,19 @@ var errAlignmentOverflow = errors.New("integer overflow when calculating alignme
2323

2424
// nextAligned finds the next offset that satisfies alignment.
2525
func nextAligned(offset int64, alignment int) (int64, error) {
26-
align64 := uint64(alignment)
27-
offset64 := uint64(offset)
26+
align64 := int64(alignment)
2827

29-
if align64 <= 0 || offset64%align64 == 0 {
28+
if align64 <= 0 || offset%align64 == 0 {
3029
return offset, nil
3130
}
3231

33-
offset64 += (align64 - offset64%align64)
32+
align64 -= offset % align64
3433

35-
if offset64 > math.MaxInt64 {
34+
if (math.MaxInt64 - offset) < align64 {
3635
return 0, errAlignmentOverflow
3736
}
3837

39-
//nolint:gosec // Overflow handled above.
40-
return int64(offset64), nil
38+
return offset + align64, nil
4139
}
4240

4341
// writeDataObjectAt writes the data object described by di to ws, using time t, recording details

pkg/siftool/del.go

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ func (c *command) getDel() *cobra.Command {
2929
return fmt.Errorf("while converting id: %w", err)
3030
}
3131

32-
//nolint:gosec // ParseUint above ensures id is safe to cast to uint32.
3332
return c.app.Del(args[1], uint32(id))
3433
},
3534
DisableFlagsInUseLine: true,

pkg/siftool/dump.go

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ func (c *command) getDump() *cobra.Command {
3030
return fmt.Errorf("while converting id: %w", err)
3131
}
3232

33-
//nolint:gosec // ParseUint above ensures id is safe to cast to uint32.
3433
return c.app.Dump(args[1], uint32(id))
3534
},
3635
DisableFlagsInUseLine: true,

pkg/siftool/info.go

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ func (c *command) getInfo() *cobra.Command {
3131
return fmt.Errorf("while converting id: %w", err)
3232
}
3333

34-
//nolint:gosec // ParseUint above ensures id is safe to cast to uint32.
3534
return c.app.Info(args[1], uint32(id))
3635
},
3736
DisableFlagsInUseLine: true,

pkg/siftool/setprim.go

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ func (c *command) getSetPrim() *cobra.Command {
2929
return fmt.Errorf("while converting id: %w", err)
3030
}
3131

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

0 commit comments

Comments
 (0)