update docs

master
Charles Iliya Krempeaux 2021-11-21 06:17:30 -08:00
parent d8ef8e226a
commit 5082385fb5
1 changed files with 17 additions and 0 deletions

View File

@ -3,10 +3,27 @@
**go-arbitrary** is a Go library which provides tools for generating arbitrary data. **go-arbitrary** is a Go library which provides tools for generating arbitrary data.
## Example ## 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() ) src := rand.NewSource( time.Now().UTC().UnixNano() )
arb := arbitrary.New(src) arb := arbitrary.New(src)
// Generate an arbitrary phonenumber.
phoneNumber := arb.PhoneNumber()
// Generate an arbitrary bool. // Generate an arbitrary bool.
// Might be false, might be true. // Might be false, might be true.
bl := arb.Bool() bl := arb.Bool()