Go library which provides tools for generating arbitrary data.
Go to file
Charles Iliya Krempeaux 5082385fb5 update docs 2021-11-21 06:17:30 -08:00
LICENSE initial commit 2015-01-29 00:45:50 -08:00
README.md update docs 2021-11-21 06:17:30 -08:00
default.go phone number, plus other changes 2021-11-20 17:46:15 -08:00
doc.go initial commit 2015-01-29 00:45:50 -08:00
t.go phone number, plus other changes 2021-11-20 17:46:15 -08:00
t_bool.go phone number, plus other changes 2021-11-20 17:46:15 -08:00
t_bool_test.go phone number, plus other changes 2021-11-20 17:46:15 -08:00
t_phonenumber.go phone number, plus other changes 2021-11-20 17:46:15 -08:00
t_phonenumber_canada.go phone number, plus other changes 2021-11-21 06:12:56 -08:00
t_runes.go phone number, plus other changes 2021-11-20 17:46:15 -08:00
t_runes_test.go phone number, plus other changes 2021-11-20 17:46:15 -08:00
t_string.go phone number, plus other changes 2021-11-20 17:46:15 -08:00
t_string_test.go phone number, plus other changes 2021-11-20 17:46:15 -08:00

README.md

go-arbitrary

go-arbitrary is a Go library which provides tools for generating arbitrary data.

Example

Here is a typical example:

// Generate an arbitrary phonenumber.
phoneNumber := arbitrary.PhoneNumber()

// Generate an arbitrary bool.
// Might be false, might be true.
bl := arbitrary.Bool()

// Generate an arbitrary string.
s := arbitrary.String()

Or if you want to provide your own souce of randomness:

src := rand.NewSource( time.Now().UTC().UnixNano() )
arb := arbitrary.New(src)

// Generate an arbitrary phonenumber.
phoneNumber := arb.PhoneNumber()

// Generate an arbitrary bool.
// Might be false, might be true.
bl := arb.Bool()

// Generate an arbitrary string.
s := arb.String()

Documention

Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-arbitrary

GoDoc