{"id":13471802,"url":"https://github.com/bxcodec/faker","last_synced_at":"2025-09-27T09:31:58.508Z","repository":{"id":22053082,"uuid":"95096549","full_name":"bxcodec/faker","owner":"bxcodec","description":"Go (Golang)  Fake Data  Generator for Struct. [Notes]This repository is archived, moved to the new repository https://github.com/go-faker/faker","archived":true,"fork":false,"pushed_at":"2022-12-08T09:23:48.000Z","size":350,"stargazers_count":2085,"open_issues_count":25,"forks_count":148,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-09-21T16:20:19.631Z","etag":null,"topics":["dummy-data","dummy-data-generator","fake-data","faker","generator","go","golang","hactoberfest","mock-data","struct","testing-tools"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/bxcodec/faker/v4","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bxcodec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["bxcodec"]}},"created_at":"2017-06-22T09:08:40.000Z","updated_at":"2024-09-19T02:59:25.000Z","dependencies_parsed_at":"2023-01-11T21:27:45.361Z","dependency_job_id":null,"html_url":"https://github.com/bxcodec/faker","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bxcodec%2Ffaker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bxcodec%2Ffaker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bxcodec%2Ffaker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bxcodec%2Ffaker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bxcodec","download_url":"https://codeload.github.com/bxcodec/faker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219871971,"owners_count":16554475,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dummy-data","dummy-data-generator","fake-data","faker","generator","go","golang","hactoberfest","mock-data","struct","testing-tools"],"created_at":"2024-07-31T16:00:49.363Z","updated_at":"2025-09-27T09:31:58.199Z","avatar_url":"https://github.com/bxcodec.png","language":"Go","readme":"\n# Important Notes\nThis repository has been archived, and **moved to the new repository** here https://github.com/go-faker/faker\nFurther development and fixing will be happening in the new repository.\n\n---\n\n# Docs\n\n## [faker](#)\n\nStruct Data Fake Generator\n\nFaker will generate you a fake data based on your Struct.\n\n[![Build Status](https://travis-ci.org/bxcodec/faker.svg?branch=master)](https://travis-ci.org/bxcodec/faker)\n[![codecov](https://codecov.io/gh/bxcodec/faker/branch/master/graph/badge.svg)](https://codecov.io/gh/bxcodec/faker)\n[![Go Report Card](https://goreportcard.com/badge/github.com/bxcodec/faker)](https://goreportcard.com/report/github.com/bxcodec/faker)\n[![License](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/bxcodec/faker/blob/master/LICENSE)\n[![Go.Dev](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go\u0026logoColor=white)](https://pkg.go.dev/github.com/bxcodec/faker/v4?tab=doc)\n\n## Index\n\n- [Support](#support)\n- [Getting Started](#getting-started)\n- [Example](#example)\n- [Limitation](#limitation)\n- [Contribution](#contribution)\n\n## Support\n\nYou can file an [Issue](https://github.com/bxcodec/faker/issues/new).\nSee documentation in [Go.Dev](https://pkg.go.dev/github.com/bxcodec/faker/v4?tab=doc)\n\n## Getting Started\n\n#### Download\n\n```shell\ngo get -u github.com/bxcodec/faker/v4\n```\n\n# Example\n\n---\n\n- Using Struct's tag:\n  - [basic tags: example_with_tags_test.go](/example_with_tags_test.go)\n  - [length and bounds: example_with_tags_lenbounds_test.go](/example_with_tags_lenbounds_test.go)\n  - [language: example_with_tags_lang_test.go](/example_with_tags_lang_test.go)\n  - [unique: example_with_tags_unique_test.go](example_with_tags_unique_test.go)\n  - [slice length: example_with_tags_slicelength_test.go](example_with_tags_slicelength_test.go)\n- Custom Struct's tag (define your own faker data): [example_custom_faker_test.go](/example_custom_faker_test.go)\n- Without struct's tag: [example_without_tag_test.go](/example_without_tag_test.go)\n- Single Fake Data Function: [example_single_fake_data_test.go](/example_single_fake_data_test.go)\n\n## DEMO\n\n---\n\n![Example to use Faker](https://cdn-images-1.medium.com/max/800/1*AkMbxngg7zfvtWiuvFb4Mg.gif)\n\n## Benchmark\n\n---\n\nBench To Generate Fake Data\n\n#### Without Tag\n\n```bash\nBenchmarkFakerDataNOTTagged-4             500000              3049 ns/op             488 B/op         20 allocs/op\n```\n\n#### Using Tag\n\n```bash\n BenchmarkFakerDataTagged-4                100000             17470 ns/op             380 B/op         26 allocs/op\n```\n\n### MUST KNOW\n\n---\n\nThe Struct Field must be PUBLIC.\u003cbr\u003e\nSupport Only For :\n\n- `int`, `int8`, `int16`, `int32` \u0026 `int64`\n- `[]int`, `[]int8`, `[]int16`, `[]int32` \u0026 `[]int64`\n- `bool` \u0026 `[]bool`\n- `string` \u0026 `[]string`\n- `float32`, `float64`, `[]float32` \u0026`[]float64`\n- `time.Time` \u0026 `[]time.Time`\n- Nested Struct Field\n\n## Limitation\n\n---\n\nUnfortunately this library has some limitation\n\n- It does not support private fields. Make sure your structs fields you intend to generate fake data for are public, it would otherwise trigger a panic. You can however omit fields using a tag skip `faker:\"-\"` on your private fields.\n- It does not support the `interface{}` data type. How could we generate anything without knowing its data type?\n- It does not support the `map[interface{}]interface{}`, `map[any_type]interface{}` \u0026 `map[interface{}]any_type` data types. Once again, we cannot generate values for an unknown data type.\n- Custom types are not fully supported. However some custom types are already supported: we are still investigating how to do this the correct way. For now, if you use `faker`, it's safer not to use any custom types in order to avoid panics.\n- Some extra custom types can be supported IF AND ONLY IF extended with [AddProvider()](https://github.com/bxcodec/faker/blob/9169c33ae9926e5b8f8732909790ee20b10b736a/faker.go#L320) please see [example](example_custom_faker_test.go#L46)\n- The `oneof` tag currently only supports `string`, the `int` types, and both `float32` \u0026 `float64`. Further support is coming soon (i.e. hex numbers, etc). See [example](example_with_tags_test.go#L53) for usage.\n\n## Contribution\n\n---\n\nTo contrib to this project, you can open a PR or an issue.\n","funding_links":["https://github.com/sponsors/bxcodec"],"categories":["Go","Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbxcodec%2Ffaker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbxcodec%2Ffaker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbxcodec%2Ffaker/lists"}