File tree 6 files changed +6
-12
lines changed
6 files changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ executors:
9
9
- image : node:22-slim
10
10
golangci-lint :
11
11
docker :
12
- - image : golangci/golangci-lint:v1.60
12
+ - image : golangci/golangci-lint:v1.61
13
13
golang-previous :
14
14
docker :
15
15
- image : golang:1.22
Original file line number Diff line number Diff line change @@ -23,21 +23,19 @@ var errAlignmentOverflow = errors.New("integer overflow when calculating alignme
23
23
24
24
// nextAligned finds the next offset that satisfies alignment.
25
25
func nextAligned (offset int64 , alignment int ) (int64 , error ) {
26
- align64 := uint64 (alignment )
27
- offset64 := uint64 (offset )
26
+ align64 := int64 (alignment )
28
27
29
- if align64 <= 0 || offset64 % align64 == 0 {
28
+ if align64 <= 0 || offset % align64 == 0 {
30
29
return offset , nil
31
30
}
32
31
33
- offset64 += ( align64 - offset64 % align64 )
32
+ align64 -= offset % align64
34
33
35
- if offset64 > math .MaxInt64 {
34
+ if ( math .MaxInt64 - offset ) < align64 {
36
35
return 0 , errAlignmentOverflow
37
36
}
38
37
39
- //nolint:gosec // Overflow handled above.
40
- return int64 (offset64 ), nil
38
+ return offset + align64 , nil
41
39
}
42
40
43
41
// writeDataObjectAt writes the data object described by di to ws, using time t, recording details
Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ func (c *command) getDel() *cobra.Command {
29
29
return fmt .Errorf ("while converting id: %w" , err )
30
30
}
31
31
32
- //nolint:gosec // ParseUint above ensures id is safe to cast to uint32.
33
32
return c .app .Del (args [1 ], uint32 (id ))
34
33
},
35
34
DisableFlagsInUseLine : true ,
Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ func (c *command) getDump() *cobra.Command {
30
30
return fmt .Errorf ("while converting id: %w" , err )
31
31
}
32
32
33
- //nolint:gosec // ParseUint above ensures id is safe to cast to uint32.
34
33
return c .app .Dump (args [1 ], uint32 (id ))
35
34
},
36
35
DisableFlagsInUseLine : true ,
Original file line number Diff line number Diff line change @@ -31,7 +31,6 @@ func (c *command) getInfo() *cobra.Command {
31
31
return fmt .Errorf ("while converting id: %w" , err )
32
32
}
33
33
34
- //nolint:gosec // ParseUint above ensures id is safe to cast to uint32.
35
34
return c .app .Info (args [1 ], uint32 (id ))
36
35
},
37
36
DisableFlagsInUseLine : true ,
Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ func (c *command) getSetPrim() *cobra.Command {
29
29
return fmt .Errorf ("while converting id: %w" , err )
30
30
}
31
31
32
- //nolint:gosec // ParseUint above ensures id is safe to cast to uint32.
33
32
return c .app .Setprim (args [1 ], uint32 (id ))
34
33
},
35
34
DisableFlagsInUseLine : true ,
You can’t perform that action at this time.
0 commit comments