From 0ad5f4a74d87a7298fb6887136a196c82c5b677b Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Fri, 8 Mar 2024 10:22:34 +0100 Subject: [PATCH] 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. --- random.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/random.go b/random.go index 27936e7..893339b 100644 --- a/random.go +++ b/random.go @@ -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: