Index: go/src/infra/gae/libs/wrapper/mathrand.go |
diff --git a/go/src/infra/gae/libs/wrapper/mathrand.go b/go/src/infra/gae/libs/wrapper/mathrand.go |
index 89c140b77cc59c3df90bf80fb98a1bbd9fd6e7a4..63fed9be93ed6d3f9078d13b860cd8a1e9c75e00 100644 |
--- a/go/src/infra/gae/libs/wrapper/mathrand.go |
+++ b/go/src/infra/gae/libs/wrapper/mathrand.go |
@@ -8,6 +8,7 @@ import ( |
"math/rand" |
"golang.org/x/net/context" |
+ "infra/libs/clock" |
) |
// MathRandFactory is the function signature for factory methods compatible with |
@@ -16,12 +17,12 @@ type MathRandFactory func(context.Context) *rand.Rand |
// GetMathRand gets a *"math/rand".Rand from the context. If one hasn't been |
// set, this creates a new Rand object with a Source initialized from the |
-// current time accordint to GetTimeNow(c).UnixNano(). |
+// current time clock.Now(c).UnixNano(). |
func GetMathRand(c context.Context) *rand.Rand { |
if f, ok := c.Value(mathRandKey).(MathRandFactory); ok && f != nil { |
return f(c) |
} |
- return rand.New(rand.NewSource(GetTimeNow(c).UnixNano())) |
+ return rand.New(rand.NewSource(clock.Now(c).UnixNano())) |
} |
// SetMathRandFactory sets the function to produce *"math/rand".Rand instances, |