LEFT | RIGHT |
(Both sides are equal) |
1 // Copyright 2014 The Go Authors. All rights reserved. | 1 // Copyright 2014 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 package rand | 5 package rand |
6 | 6 |
7 import ( | 7 import ( |
8 "internal/syscall" | 8 "internal/syscall" |
9 "sync" | 9 "sync" |
10 ) | 10 ) |
(...skipping 19 matching lines...) Expand all Loading... |
30 } | 30 } |
31 | 31 |
32 func getRandomLinux(p []byte) (ok bool) { | 32 func getRandomLinux(p []byte) (ok bool) { |
33 once.Do(pickStrategy) | 33 once.Do(pickStrategy) |
34 if !useSyscall { | 34 if !useSyscall { |
35 return false | 35 return false |
36 } | 36 } |
37 n, err := syscall.GetRandom(p, 0) | 37 n, err := syscall.GetRandom(p, 0) |
38 return n == len(p) && err == nil | 38 return n == len(p) && err == nil |
39 } | 39 } |
LEFT | RIGHT |