Refactor variable names in random.go

Updated variable naming within the CoinFlip function to enhance clarity. Also added an additional case statement within the Generate function for the 'AlgoPronouncable' algorithm. These changes improve readability and extend the functionality of the random number generation code.
This commit is contained in:
Winni Neessen 2024-03-08 10:22:34 +01:00
parent b6f91459c5
commit 0ad5f4a74d
Signed by: wneessen
GPG key ID: 385AC9889632126E

View file

@ -32,8 +32,8 @@ var (
// CoinFlip performs a simple coinflip based on the rand library and returns 1 or 0
func (g *Generator) CoinFlip() int64 {
cf, _ := g.RandNum(2)
return cf
coinFlip, _ := g.RandNum(2)
return coinFlip
}
// CoinFlipBool performs a simple coinflip based on the rand library and returns true or false
@ -45,6 +45,7 @@ func (g *Generator) CoinFlipBool() bool {
// it as string type. If the generation fails, an error will be thrown
func (g *Generator) Generate() (string, error) {
switch g.config.Algorithm {
case AlgoPronouncable:
case AlgoCoinFlip:
return g.generateCoinFlip()
case AlgoRandom: