Skip to content

Commit

Permalink
feat: Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
acaloiaro committed Sep 2, 2023
1 parent 342aad6 commit 5a00fa1
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions internal/internal.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package internal

import (
crand "crypto/rand"
"math"
"math/big"
"math/rand"
"regexp"
"time"
Expand All @@ -30,16 +28,8 @@ func CalculateBackoff(retryCount int) time.Time {

// RandInt returns a random integer up to max
func RandInt(max int) int {
if true {
r := rand.New(rand.NewSource(time.Now().UnixNano())) // nolint: gosec
return r.Intn(max)
}

r, err := crand.Int(crand.Reader, big.NewInt(int64(max)))
if err != nil {
panic(err)
}
return int(r.Int64())
r := rand.New(rand.NewSource(time.Now().UnixNano())) // nolint: gosec
return r.Intn(max)
}

// StripNonAlphanum strips nonalphanumeric/non underscore characters from a string and returns a new one
Expand Down

0 comments on commit 5a00fa1

Please sign in to comment.