github.com/traefik/yaegi@v0.15.1/stdlib/go1_20_math_rand.go (about)

     1  // Code generated by 'yaegi extract math/rand'. DO NOT EDIT.
     2  
     3  //go:build go1.20
     4  // +build go1.20
     5  
     6  package stdlib
     7  
     8  import (
     9  	"math/rand"
    10  	"reflect"
    11  )
    12  
    13  func init() {
    14  	Symbols["math/rand/rand"] = map[string]reflect.Value{
    15  		// function, constant and variable definitions
    16  		"ExpFloat64":  reflect.ValueOf(rand.ExpFloat64),
    17  		"Float32":     reflect.ValueOf(rand.Float32),
    18  		"Float64":     reflect.ValueOf(rand.Float64),
    19  		"Int":         reflect.ValueOf(rand.Int),
    20  		"Int31":       reflect.ValueOf(rand.Int31),
    21  		"Int31n":      reflect.ValueOf(rand.Int31n),
    22  		"Int63":       reflect.ValueOf(rand.Int63),
    23  		"Int63n":      reflect.ValueOf(rand.Int63n),
    24  		"Intn":        reflect.ValueOf(rand.Intn),
    25  		"New":         reflect.ValueOf(rand.New),
    26  		"NewSource":   reflect.ValueOf(rand.NewSource),
    27  		"NewZipf":     reflect.ValueOf(rand.NewZipf),
    28  		"NormFloat64": reflect.ValueOf(rand.NormFloat64),
    29  		"Perm":        reflect.ValueOf(rand.Perm),
    30  		"Read":        reflect.ValueOf(rand.Read),
    31  		"Seed":        reflect.ValueOf(rand.Seed),
    32  		"Shuffle":     reflect.ValueOf(rand.Shuffle),
    33  		"Uint32":      reflect.ValueOf(rand.Uint32),
    34  		"Uint64":      reflect.ValueOf(rand.Uint64),
    35  
    36  		// type definitions
    37  		"Rand":     reflect.ValueOf((*rand.Rand)(nil)),
    38  		"Source":   reflect.ValueOf((*rand.Source)(nil)),
    39  		"Source64": reflect.ValueOf((*rand.Source64)(nil)),
    40  		"Zipf":     reflect.ValueOf((*rand.Zipf)(nil)),
    41  
    42  		// interface wrapper definitions
    43  		"_Source":   reflect.ValueOf((*_math_rand_Source)(nil)),
    44  		"_Source64": reflect.ValueOf((*_math_rand_Source64)(nil)),
    45  	}
    46  }
    47  
    48  // _math_rand_Source is an interface wrapper for Source type
    49  type _math_rand_Source struct {
    50  	IValue interface{}
    51  	WInt63 func() int64
    52  	WSeed  func(seed int64)
    53  }
    54  
    55  func (W _math_rand_Source) Int63() int64 {
    56  	return W.WInt63()
    57  }
    58  func (W _math_rand_Source) Seed(seed int64) {
    59  	W.WSeed(seed)
    60  }
    61  
    62  // _math_rand_Source64 is an interface wrapper for Source64 type
    63  type _math_rand_Source64 struct {
    64  	IValue  interface{}
    65  	WInt63  func() int64
    66  	WSeed   func(seed int64)
    67  	WUint64 func() uint64
    68  }
    69  
    70  func (W _math_rand_Source64) Int63() int64 {
    71  	return W.WInt63()
    72  }
    73  func (W _math_rand_Source64) Seed(seed int64) {
    74  	W.WSeed(seed)
    75  }
    76  func (W _math_rand_Source64) Uint64() uint64 {
    77  	return W.WUint64()
    78  }