Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
data/ | H | 26-Sep-2015 | - | |||
test/ | H | 26-Sep-2015 | - | |||
.gitignore | H A D | 26-Sep-2015 | 276 | |||
.travis.yml | H A D | 26-Sep-2015 | 103 | |||
LICENSE | H A D | 26-Sep-2015 | 1.1 KiB | |||
README.md | H A D | 26-Sep-2015 | 1.9 KiB | |||
addresses.go | H A D | 26-Sep-2015 | 1.5 KiB | |||
credit_cards.go | H A D | 26-Sep-2015 | 1.5 KiB | |||
currencies.go | H A D | 26-Sep-2015 | 235 | |||
data.go | H A D | 26-Sep-2015 | 78.5 KiB | |||
dates.go | H A D | 26-Sep-2015 | 873 | |||
fake.go | H A D | 26-Sep-2015 | 4.9 KiB | |||
general.go | H A D | 26-Sep-2015 | 2.1 KiB | |||
geo.go | H A D | 26-Sep-2015 | 1.1 KiB | |||
internet.go | H A D | 26-Sep-2015 | 1.3 KiB | |||
jobs.go | H A D | 26-Sep-2015 | 429 | |||
lorem_ipsum.go | H A D | 26-Sep-2015 | 2 KiB | |||
names.go | H A D | 26-Sep-2015 | 3.4 KiB | |||
personal.go | H A D | 26-Sep-2015 | 428 | |||
products.go | H A D | 26-Sep-2015 | 709 |
README.md
1[![Build Status](https://img.shields.io/travis/antonholmquist/jason.svg?style=flat)](https://travis-ci.org/antonholmquist/jason) [![Godoc](http://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/icrowley/fake) [![license](http://img.shields.io/badge/license-MIT-red.svg?style=flat)](https://raw.githubusercontent.com/icrowley/fake/master/LICENSE) 2 3Fake 4==== 5 6Fake is a fake data generator for Go (Golang), heavily inspired by the forgery and ffaker Ruby gems. 7 8## About 9 10Most data and methods are ported from forgery/ffaker Ruby gems. 11For the list of available methods please look at https://godoc.org/github.com/icrowley/fake. 12Currently english and russian languages are available. 13 14Fake embeds samples data files unless you call `UseExternalData(true)` in order to be able to work without external files dependencies when compiled, so, if you add new data files or make changes to existing ones don't forget to regenerate data.go file using `github.com/mjibson/esc` tool and `esc -o data.go -pkg fake data` command (or you can just use `go generate` command if you are using Go 1.4 or later). 15 16## Install 17 18```shell 19go get github.com/icrowley/fake 20``` 21 22## Import 23 24```go 25import ( 26 "github.com/icrowley/fake" 27) 28``` 29 30## Documentation 31 32Documentation can be found at godoc: 33 34https://godoc.org/github.com/icrowley/fake 35 36## Test 37To run the project tests: 38 39```shell 40cd test 41go test 42``` 43 44## Examples 45 46```go 47name := fake.FirstName() 48fullname = := fake.FullName() 49product := fake.Product() 50``` 51 52Changing language: 53 54```go 55err := fake.SetLang("ru") 56if err != nil { 57 panic(err) 58} 59password := fake.SimplePassword() 60``` 61 62Using english fallback: 63 64```go 65err := fake.SetLang("ru") 66if err != nil { 67 panic(err) 68} 69fake.EnFallback(true) 70password := fake.Paragraph() 71``` 72 73Using external data: 74 75```go 76fake.UseExternalData(true) 77password := fake.Paragraph() 78``` 79 80### Author 81 82Dmitry Afanasyev, 83http://twitter.com/i_crowley 84dimarzio1986@gmail.com 85