Skip to content

Commit

Permalink
fix: address lint with golangci-lint v1.60
Browse files Browse the repository at this point in the history
  • Loading branch information
tri-adam committed Aug 22, 2024
1 parent f4453b3 commit 1b7e347
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/sif/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func nextAligned(offset int64, alignment int) int64 {
offset64 = (offset64 & ^(align64 - 1)) + align64
}

return int64(offset64)
return int64(offset64) //nolint:gosec // Overflow handled above.
}

// writeDataObjectAt writes the data object described by di to ws, using time t, recording details
Expand Down Expand Up @@ -92,7 +92,7 @@ func (f *FileImage) writeDataObject(i int, di DescriptorInput, t time.Time) erro
}

d := &f.rds[i]
d.ID = uint32(i) + 1
d.ID = uint32(i) + 1 //nolint:gosec // Overflow handled above.

f.h.DataSize = f.calculatedDataSize()

Expand Down
1 change: 1 addition & 0 deletions pkg/siftool/del.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ 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: 1 addition & 0 deletions pkg/siftool/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ 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: 1 addition & 0 deletions pkg/siftool/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ 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: 1 addition & 0 deletions pkg/siftool/setprim.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ 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 1b7e347

Please sign in to comment.