Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Struct Faker for Go
| Date | Stars |
|---|---|
| 2026-07-24 | 344 |
| 2026-07-25 | 344 |
| 2026-07-28 | 344 |
| 2026-07-30 | 344 |
| 2026-08-06 | 344 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
### Fako
[](https://circleci.com/gh/wawandco/fako) [](https://godoc.org/github.com/wawandco/fako)
[](https://goreportcard.com/report/github.com/wawandco/fako)
**Fako** is a library intended to fake Golang structs with fake but coherent data, **Fako** maps struct field tags and generates fake data accordingly. When no tag is specified, **Fako** can also automatically match field names with available faker functions.
We find it useful when writing specs to generate fake database data, hope you too.
#### Examples
##### Basic Usage with Tags
This is an example of how **Fako** works with explicit tags.
```go
import(
"fmt"
"github.com/wawandco/fako"
)
type User struct {
Name string `fako:"full_name"`
Username string `fako:"user_name"`
Email string `fako:"email_address"`//Notice the fako:"email_address" tag
Phone string `fako:"phone"`
Password string `fako:"simple_password"`
Address string `fako:"street_address"`
}
func main(){
var user User
fako.Fill(&user)
fmt.Println(user.Email)
// This prints something like [email protected]
// or another valid email
var userWithOnlyEmail User
fako.FillOnly(&userWithOnlyEmail, "Email")
//This will fill all only the email
var userWithoutEmail User
fako.FillExcept(&userWithoutEmail, "Email")
//This will fill all the fields except the email
}
```
##### Field Name Matching (No Tags Required)
**Fako** can automatically match field names with faker functions when no `fako` tag is specified. This makes it even easier to generate fake data without needing to add tags to every field.
```go
import(
"fmt"
"github.com/wawandco/fako"
)
type User struct {
FullName string // Automatically matches "FullName" faker
EmailAddress string // Automatically matches "EmailAddress" faker
Phone string // Automatically matches "Phone" faker
UserName string // Automatically matches "UserName" faker
Company string // Automatically matches "Company" faker
// Field names with underscores are camelized for matching
Street_Address string // Matches "StreetAddress" faker
// Fields that don't match any faker remain empty
CustomField string
// Explicit tags take precedence over field name matching
Name string `fako:"city"` // Uses "city" faker, not field name
}
func main(){
var user User
fako.Fill(&user)
fmt.Printf("FullName: %s\n", user.FullName)
fmt.Printf("EmailAddress: %s\n", user.EmailAddress)
fmt.Printf("Phone: %s\n", user.Phone)
fmt.Printf("Street_Address: %s\n", user.Street_Address)
fmt.Printf("CustomField: '%s'\n", user.CustomField) // Empty
fmt.Printf("Name: %s\n", user.Name) // Uses city faker due to tag
// Field name matching also works with FillOnly and FillExcept
var user2 User
fako.FillOnly(&user2, "FullName", "EmailAddress")
// Only FullName and EmailAddress will be filled
var user3 User
fako.FillExcept(&user3, "Phone")
// All matching fields except Phone will be filled
}
```
**How Field Name Matching Works:**
- Field names are converted to CamelCase (e.g., `street_address` → `StreetAddress`)
- The camelized name is matched against available faker functions
- If a match is found, the corresponding faker is used
- If no match is found, the field remains empty
- Explicit `fako` tags always take precedence over field name matching
**Common Field Name Mappings:**
Here are some examples of field names that will automatically match faker functions:
```go
type Example struct {
// Personal Information
FirstName string // → fake.FirstName()
LastName string // → fake.LastName()
FullName string // → fake.FullName()
UserName string // → fake.UserName()
// Contact Information
EmailAddress string // → fake.EmailAddress()
Phone string // → fake.PhonExcerpt of 8,397 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:633fd28991033e4c, topic:testing