Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rastogiji/go-faker
This library allows you to generate fake data.
https://github.com/rastogiji/go-faker
Last synced: about 2 months ago
JSON representation
This library allows you to generate fake data.
- Host: GitHub
- URL: https://github.com/rastogiji/go-faker
- Owner: rastogiji
- Created: 2024-08-25T14:20:58.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-25T20:17:16.000Z (5 months ago)
- Last Synced: 2024-08-26T15:41:11.542Z (5 months ago)
- Language: Go
- Size: 558 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go Faker
A simple library to generate fake data for testing purposes in Go.## Installation
```bash
go get github.com/rastogiji/go-faker
```## Simple Usage
```go
import "github.com/rastogiji/go-faker"f := gofaker.New()
f.FirstName()
f.LastName()
f.FullName()
f.Email()
f.Phone()
f.Country()
f.Profession()
```## Struct Usage
```go
import "github.com/rastogiji/go-fakertype Person struct {
FirstName string `faker:"first_name"`
LastName string `faker:"last_name"`
Email string `faker:"email,32"`
Country string `faker:"country,123"`
Phone string `faker:"phone"`
Profession string `faker:"profession"`
}func main(){
f:= gofaker.New()
p := Person{}
f.Struct(&p)
fmt.Println(p)
}
```
Feel free to open an issue or PR for any feature request or bug fix.
```