summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/spf13/afero/ioutil.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/spf13/afero/ioutil.go')
-rw-r--r--vendor/github.com/spf13/afero/ioutil.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/vendor/github.com/spf13/afero/ioutil.go b/vendor/github.com/spf13/afero/ioutil.go
index a403133e..386c9cdc 100644
--- a/vendor/github.com/spf13/afero/ioutil.go
+++ b/vendor/github.com/spf13/afero/ioutil.go
@@ -141,7 +141,7 @@ func WriteFile(fs Fs, filename string, data []byte, perm os.FileMode) error {
// We generate random temporary file names so that there's a good
// chance the file doesn't exist yet - keeps the number of tries in
// TempFile to a minimum.
-var rand uint32
+var randNum uint32
var randmu sync.Mutex
func reseed() uint32 {
@@ -150,12 +150,12 @@ func reseed() uint32 {
func nextRandom() string {
randmu.Lock()
- r := rand
+ r := randNum
if r == 0 {
r = reseed()
}
r = r*1664525 + 1013904223 // constants from Numerical Recipes
- rand = r
+ randNum = r
randmu.Unlock()
return strconv.Itoa(int(1e9 + r%1e9))[1:]
}
@@ -194,7 +194,7 @@ func TempFile(fs Fs, dir, pattern string) (f File, err error) {
if os.IsExist(err) {
if nconflict++; nconflict > 10 {
randmu.Lock()
- rand = reseed()
+ randNum = reseed()
randmu.Unlock()
}
continue
@@ -226,7 +226,7 @@ func TempDir(fs Fs, dir, prefix string) (name string, err error) {
if os.IsExist(err) {
if nconflict++; nconflict > 10 {
randmu.Lock()
- rand = reseed()
+ randNum = reseed()
randmu.Unlock()
}
continue