mirror of
https://github.com/securego/gosec.git
synced 2025-11-25 22:22:17 +02:00
Backport test case for 1.5
Go 1.5 does not have a rand.Read function so need to adjust test definitions accordingly.
This commit is contained in:
@@ -51,7 +51,7 @@ func TestRandBad(t *testing.T) {
|
||||
import "math/rand"
|
||||
|
||||
func main() {
|
||||
bad, _ := rand.Read(nil)
|
||||
bad := rand.Int()
|
||||
println(bad)
|
||||
|
||||
}`, analyzer)
|
||||
@@ -77,7 +77,7 @@ func TestRandRenamed(t *testing.T) {
|
||||
func main() {
|
||||
good, _ := rand.Read(nil)
|
||||
println(good)
|
||||
i := mrand.Int()
|
||||
i := mrand.Int31()
|
||||
println(i)
|
||||
}`, analyzer)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user