Debian Codegraph @

testhelpers/random.go

raw symbols SCIP
1 package testhelpersscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/
2
3 import (
4 "math/randscip-go gomod github.com/golang/go/src go1.13 `math/rand`/"
5 "timescip-go gomod github.com/golang/go/src go1.13 time/"
6 )
7
8 func RandomIntscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/RandomInt().() int {
9 reseedscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/reseed().()
10 return randscip-go gomod github.com/golang/go/src go1.13 `math/rand`/.Newscip-go gomod github.com/golang/go/src go1.13 `math/rand`/New().(randscip-go gomod github.com/golang/go/src go1.13 `math/rand`/.NewSourcescip-go gomod github.com/golang/go/src go1.13 `math/rand`/NewSource().(timescip-go gomod github.com/golang/go/src go1.13 time/.Nowscip-go gomod github.com/golang/go/src go1.13 time/Now().().UnixNanoscip-go gomod github.com/golang/go/src go1.13 time/Time#UnixNano().())).Intscip-go gomod github.com/golang/go/src go1.13 `math/rand`/Rand#Int().()
11 }
12
13 func RandomStringscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/RandomString().() string {
14 size := 5
15 charSet := "abcdefghijklmnopqrstuvwxyz0123456789"
16
17 reseedscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/reseed().()
18 result := make([]byte, size)
19 for i := 0; i < size; i++ {
20 result[i] = charSet[randscip-go gomod github.com/golang/go/src go1.13 `math/rand`/.Intnscip-go gomod github.com/golang/go/src go1.13 `math/rand`/Intn().(len(charSet))]
21 }
22 return string(result)
23 }
24
25 func reseedscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/testhelpers`/reseed().() {
26 randscip-go gomod github.com/golang/go/src go1.13 `math/rand`/.Seedscip-go gomod github.com/golang/go/src go1.13 `math/rand`/Seed().(timescip-go gomod github.com/golang/go/src go1.13 time/.Nowscip-go gomod github.com/golang/go/src go1.13 time/Now().().UTCscip-go gomod github.com/golang/go/src go1.13 time/Time#UTC().().UnixNanoscip-go gomod github.com/golang/go/src go1.13 time/Time#UnixNano().())
27 }