go-faker / faker

Go (Golang) Fake Data Generator for Struct, previously https://github.com/bxcodec/faker
https://pkg.go.dev/github.com/go-faker/faker/v4
MIT License
614 stars 30 forks source link

A Way to generate fake data with custom Tag #17

Open confusionhill opened 1 year ago

confusionhill commented 1 year ago

Hello, I wanted to know if it's possible to generate a fake data with custom tag? My struct is

type Lecture struct { FullName string faker:"name" }

expected output

{"full_name": "value"}

muhfaris commented 1 year ago

hi @confusionhill you can try this https://pkg.go.dev/github.com/go-faker/faker/v4#example-package-CustomFaker