mirror of
https://github.com/acaloiaro/neoq
synced 2026-07-21 18:29:08 +00:00
feat: Remove dead code
This commit is contained in:
parent
342aad6fe2
commit
5a00fa1f89
1 changed files with 2 additions and 12 deletions
|
|
@ -1,9 +1,7 @@
|
||||||
package internal
|
package internal
|
||||||
|
|
||||||
import (
|
import (
|
||||||
crand "crypto/rand"
|
|
||||||
"math"
|
"math"
|
||||||
"math/big"
|
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"regexp"
|
"regexp"
|
||||||
"time"
|
"time"
|
||||||
|
|
@ -30,16 +28,8 @@ func CalculateBackoff(retryCount int) time.Time {
|
||||||
|
|
||||||
// RandInt returns a random integer up to max
|
// RandInt returns a random integer up to max
|
||||||
func RandInt(max int) int {
|
func RandInt(max int) int {
|
||||||
if true {
|
|
||||||
r := rand.New(rand.NewSource(time.Now().UnixNano())) // nolint: gosec
|
r := rand.New(rand.NewSource(time.Now().UnixNano())) // nolint: gosec
|
||||||
return r.Intn(max)
|
return r.Intn(max)
|
||||||
}
|
|
||||||
|
|
||||||
r, err := crand.Int(crand.Reader, big.NewInt(int64(max)))
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
return int(r.Int64())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// StripNonAlphanum strips nonalphanumeric/non underscore characters from a string and returns a new one
|
// StripNonAlphanum strips nonalphanumeric/non underscore characters from a string and returns a new one
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue