Update variable name in random.go

Changed the abbreviation 'idx' to 'i' in the 'random.go' file. This change makes the variable roles much clearer and aligns the naming with Go's best practice, enhancing readability and maintainability.
This commit is contained in:
Winni Neessen 2024-02-27 11:43:05 +01:00
parent 6c9b875f58
commit 514e68be54
Signed by: wneessen
GPG key ID: 385AC9889632126E

View file

@ -42,8 +42,8 @@ func randomStringSecure(length int) (string, error) {
}
char, rest = binary.BigEndian.Uint64(randPool), letterIdxMax
}
if idx := int(char & letterIdxMask); idx < charRangeLength {
randString.WriteByte(cr[idx])
if i := int(char & letterIdxMask); i < charRangeLength {
randString.WriteByte(cr[i])
idx--
}
char >>= letterIdxBits