diff --git a/README.md b/README.md index ae1f158..1dd9967 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,13 @@ Fake Fake is a fake data generator for Go (Golang), heavily inspired by the forgery and ffaker Ruby gems. -# About +## About Most data and methods are ported from forgery/ffaker Ruby gems. For the list of available methods please look at https://godoc.org/github.com/icrowley/fake. Currently english and russian languages are available. -Feel free to add other languages, but don't forget to regenerate data.go file using `github.com/mjibson/esc` tool and `esc -o data.go -pkg fake data` command because Fake embeds files unless you call `UseExternalData(true)` in order to be able to work without external files dependencies when compiled. + +Fake 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). ## Install @@ -76,7 +77,7 @@ fake.UseExternalData(true) password := fake.Paragraph() ``` -## Author +### Author Dmitry Afanasyev, http://twitter.com/i_crowley diff --git a/fake.go b/fake.go index 8564f53..2a9ba3b 100644 --- a/fake.go +++ b/fake.go @@ -2,8 +2,12 @@ Package fake is the fake data generatror for go (Golang), heavily inspired by forgery and ffaker Ruby gems Most data and methods are ported from forgery/ffaker Ruby gems. + Currently english and russian languages are available. -Feel free to add other languages, but don't forget to regenerate data.go file using `github.com/mjibson/esc` tool and `esc -o data.go -pkg fake data` command because Fake embeds files unless you call `UseExternalData(true)` in order to be able to work without external file dependencies when compiled. + +For the list of available methods please look at https://godoc.org/github.com/icrowley/fake. + +Fake 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). Examples: name := fake.FirstName() @@ -40,6 +44,9 @@ import ( "time" ) +//go:generate go get github.com/mjibson/esc +//go:generate esc -o data.go -pkg fake data + // cat/subcat/lang/samples type samplesTree map[string]map[string][]string