Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Kryuchkov <42733472+kr-ilya@users.noreply.github.com>2026-01-05 07:54:56 +0300
committerGitHub <noreply@github.com>2026-01-05 07:54:56 +0300
commit6041d10e3d5d8b0021dd596bdee8f0064a495f80 (patch)
tree897ac55d8389dfea859e6071d08c56f97e843a09 /util/random/random.go
parent4800f8fb706a092a38255ee70904227238b2a6f6 (diff)
Refactor code and fix linter warnings (#3627)
* refactor: use any instead of empty interface * refactor: code cleanup
Diffstat (limited to 'util/random/random.go')
-rw-r--r--util/random/random.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/util/random/random.go b/util/random/random.go
index c746df63..ddb819c1 100644
--- a/util/random/random.go
+++ b/util/random/random.go
@@ -18,10 +18,10 @@ var (
// init initializes the character sequences used for random string generation.
// It sets up arrays for numbers, lowercase letters, uppercase letters, and combinations.
func init() {
- for i := 0; i < 10; i++ {
+ for i := range 10 {
numSeq[i] = rune('0' + i)
}
- for i := 0; i < 26; i++ {
+ for i := range 26 {
lowerSeq[i] = rune('a' + i)
upperSeq[i] = rune('A' + i)
}
@@ -40,7 +40,7 @@ func init() {
// Seq generates a random string of length n containing alphanumeric characters (numbers, lowercase and uppercase letters).
func Seq(n int) string {
runes := make([]rune, n)
- for i := 0; i < n; i++ {
+ for i := range n {
idx, err := rand.Int(rand.Reader, big.NewInt(int64(len(allSeq))))
if err != nil {
panic("crypto/rand failed: " + err.Error())