Skip to content

Commit

Permalink
Merge pull request #18 from plainq/linter-and-test-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
heartwilltell authored Feb 4, 2025
2 parents 2a2d3f9 + 44dab40 commit c14190e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions authkit/hashkit/hasher.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ type Option func(hasher *BCryptHasher)
// If provided cost exceed out of acceptable boundary
// then min or max cost wil be set.
func WithCost(cost int) Option {
var finalCost int
c := cost

if cost < bcrypt.MinCost {
finalCost = bcrypt.MinCost
if c < bcrypt.MinCost {
c = bcrypt.MinCost
}

if cost > bcrypt.MaxCost {
finalCost = bcrypt.MaxCost
if c > bcrypt.MaxCost {
c = bcrypt.MaxCost
}

return func(h *BCryptHasher) {
h.cost = finalCost
h.cost = c
}
}

Expand Down
2 changes: 1 addition & 1 deletion dbkit/litekit/schema_evolution.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func (e *Evolver) loadMutations() ([]Mutation, error) {
}

evolutions = append(evolutions, Mutation{
version: uint(i + 1),
version: uint(i + 1), //nolint:gosec // i is always positive
changes: changes,
})
}
Expand Down

0 comments on commit c14190e

Please sign in to comment.