• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

data/H26-Sep-2015-

test/H26-Sep-2015-

.gitignoreH A D26-Sep-2015276

.travis.ymlH A D26-Sep-2015103

LICENSEH A D26-Sep-20151.1 KiB

README.mdH A D26-Sep-20151.9 KiB

addresses.goH A D26-Sep-20151.5 KiB

credit_cards.goH A D26-Sep-20151.5 KiB

currencies.goH A D26-Sep-2015235

data.goH A D26-Sep-201578.5 KiB

dates.goH A D26-Sep-2015873

fake.goH A D26-Sep-20154.9 KiB

general.goH A D26-Sep-20152.1 KiB

geo.goH A D26-Sep-20151.1 KiB

internet.goH A D26-Sep-20151.3 KiB

jobs.goH A D26-Sep-2015429

lorem_ipsum.goH A D26-Sep-20152 KiB

names.goH A D26-Sep-20153.4 KiB

personal.goH A D26-Sep-2015428

products.goH A D26-Sep-2015709

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