Created
November 13, 2015 02:30
-
-
Save caelifer/4a0f21ba637ab2b363fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"reflect" | |
"testing/quick" | |
) | |
type Point struct { | |
X, Y byte | |
} | |
func main() { | |
rnd := rand.New(rand.NewSource(42)) | |
t := reflect.TypeOf(Point{}) | |
v, _ := quick.Value(t, rnd) | |
fmt.Println(v) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Taken from here - https://www.youtube.com/watch?v=P7EzIJZljhY
Live code - http://play.golang.org/p/x_GMv00jQy