Mercurial > gemma
comparison pkg/common/random.go @ 4162:8c5df0f3562e
Made 'golint' and 'staticcheck' happy with common package.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 02 Aug 2019 17:53:18 +0200 |
parents | 01ce3ba9b0d0 |
children | 5f47eeea988d |
comparison
equal
deleted
inserted
replaced
4161:64cd18281c76 | 4162:8c5df0f3562e |
---|---|
66 log.Println("warn: Your random generator may be broken.") | 66 log.Println("warn: Your random generator may be broken.") |
67 out[0] = special[0] | 67 out[0] = special[0] |
68 return string(out) | 68 return string(out) |
69 } | 69 } |
70 | 70 |
71 // Random returns a function which generates pseudo random | |
72 // values in the range between low and high. | |
71 func Random(low, high float64) func() float64 { | 73 func Random(low, high float64) func() float64 { |
72 if low > high { | 74 if low > high { |
73 low, high = high, low | 75 low, high = high, low |
74 } | 76 } |
75 | 77 |