{"id":19196029,"url":"https://github.com/acj/scrub","last_synced_at":"2025-02-23T04:42:50.561Z","repository":{"id":219468988,"uuid":"749129675","full_name":"acj/scrub","owner":"acj","description":"Recursively walk a Go struct and zero out specific fields","archived":false,"fork":false,"pushed_at":"2024-05-09T01:40:23.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-04T09:08:47.698Z","etag":null,"topics":["go","recursion","sanitize","struct","testing","walk"],"latest_commit_sha":null,"homepage":"","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/acj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-27T17:05:22.000Z","updated_at":"2024-05-09T01:40:26.000Z","dependencies_parsed_at":"2024-06-21T15:40:06.614Z","dependency_job_id":"7057e38e-173a-4609-8970-fa84794f7251","html_url":"https://github.com/acj/scrub","commit_stats":null,"previous_names":["acj/scrub"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acj%2Fscrub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acj%2Fscrub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acj%2Fscrub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acj%2Fscrub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acj","download_url":"https://codeload.github.com/acj/scrub/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240271519,"owners_count":19774859,"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":["go","recursion","sanitize","struct","testing","walk"],"created_at":"2024-11-09T12:12:16.230Z","updated_at":"2025-02-23T04:42:50.540Z","avatar_url":"https://github.com/acj.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# scrub\n\nRecursively set specific struct fields to their zero values\n\nPossible use cases:\n  - scrubbing sensitive data from structs before logging\n  - comparing structs with noisy fields (timestamps, random values, etc) for testing or diagnostic purposes\n\n## Examples\n\n### Using struct tags\n\n```go\npackage main\n\nimport (\n  \"fmt\"\n\n  \"github.com/acj/scrub\"\n)\n\ntype User struct {\n  Name string\n  Age  int    `scrub:\"true\"`\n}\n\nfunc main() {\n  user := User{\n    Name: \"Wall-E\",\n    Age:  22,\n  }\n  scrub.TaggedFields(\u0026user)\n  fmt.Printf(\"%+v\\n\", user) // {Name:Wall-E Age:0}\n}\n```\n\n### Using named fields (blocklist)\n\n```go\npackage main\n\nimport (\n  \"fmt\"\n\n  \"github.com/acj/scrub\"\n)\n\ntype User struct {\n  Name string\n  Age  int\n}\n\nfunc main() {\n  user := User{\n    Name: \"Wall-E\",\n    Age:  22,\n  }\n  scrub.NamedFields(\u0026user, \"Age\")\n  fmt.Printf(\"%+v\\n\", user) // {Name:Wall-E Age:0}\n}\n```\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facj%2Fscrub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facj%2Fscrub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facj%2Fscrub/lists"}