Charles Iliya Krempeaux 1f5dcd5b8a | ||
---|---|---|
LICENSE | ||
README.md | ||
default.go | ||
doc.go | ||
go.mod | ||
go.sum | ||
languages.go | ||
passwords.go | ||
t.go | ||
t_bool.go | ||
t_bool_test.go | ||
t_htmlfile.go | ||
t_netaddr.go | ||
t_netport.go | ||
t_password.go | ||
t_pctencoded.go | ||
t_phonenumber.go | ||
t_phonenumber_10thoframadan.go | ||
t_phonenumber_alexandria.go | ||
t_phonenumber_arish.go | ||
t_phonenumber_aswan.go | ||
t_phonenumber_asyut.go | ||
t_phonenumber_benha.go | ||
t_phonenumber_benisuef.go | ||
t_phonenumber_canada.go | ||
t_phonenumber_damanhur.go | ||
t_phonenumber_damietta.go | ||
t_phonenumber_egypt.go | ||
t_phonenumber_egypt_3_4.go | ||
t_phonenumber_egypt_4_4.go | ||
t_phonenumber_eltor.go | ||
t_phonenumber_faiyum.go | ||
t_phonenumber_greatercairo.go | ||
t_phonenumber_ismailia.go | ||
t_phonenumber_kafrelsheikh.go | ||
t_phonenumber_luxor.go | ||
t_phonenumber_mansoura.go | ||
t_phonenumber_marsamatruh.go | ||
t_phonenumber_minya.go | ||
t_phonenumber_monufia.go | ||
t_phonenumber_newvalley.go | ||
t_phonenumber_portsaid.go | ||
t_phonenumber_qalyubia.go | ||
t_phonenumber_qena.go | ||
t_phonenumber_redsea.go | ||
t_phonenumber_sohag.go | ||
t_phonenumber_suez.go | ||
t_phonenumber_tanta.go | ||
t_phonenumber_zagazig.go | ||
t_regularfile.go | ||
t_runes.go | ||
t_runes_test.go | ||
t_string.go | ||
t_string_test.go | ||
t_textfile.go | ||
words_english.go | ||
words_korean.go | ||
words_spanish.go |
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 phone‐number.
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 phone‐number.
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