LCOV - code coverage report
Current view: top level - pebble/internal/randvar - rand.go (source / functions) Hit Total Coverage
Test: 2024-07-03 08:16Z 4981bd0e - meta test only.lcov Lines: 0 8 0.0 %
Date: 2024-07-03 08:17:03 Functions: 0 0 -

          Line data    Source code
       1             : // Copyright 2019 The LevelDB-Go and Pebble Authors. All rights reserved. Use
       2             : // of this source code is governed by a BSD-style license that can be found in
       3             : // the LICENSE file.
       4             : 
       5             : package randvar
       6             : 
       7             : import (
       8             :         "time"
       9             : 
      10             :         "golang.org/x/exp/rand"
      11             : )
      12             : 
      13             : // NewRand creates a new random number generator seeded with the current time.
      14           0 : func NewRand() *rand.Rand {
      15           0 :         return rand.New(rand.NewSource(uint64(time.Now().UnixNano())))
      16           0 : }
      17             : 
      18           0 : func ensureRand(rng *rand.Rand) *rand.Rand {
      19           0 :         if rng != nil {
      20           0 :                 return rng
      21           0 :         }
      22           0 :         return NewRand()
      23             : }

Generated by: LCOV version 1.14