Mastering-Go-Second-Edition/ch11/randomBuiltin.go
Mihalis Tsoukalos b0fce68955 Using testing/quick
2019-04-23 19:00:44 +03:00

21 lines
301 B
Go

package main
import (
"fmt"
"math/rand"
"reflect"
"testing/quick"
"time"
)
func main() {
type point3D struct {
X, Y, Z int8
S float32
}
ran := rand.New(rand.NewSource(time.Now().Unix()))
myValues := reflect.TypeOf(point3D{})
x, _ := quick.Value(myValues, ran)
fmt.Println(x)
}