{"id":22197014,"url":"https://github.com/tada-team/swap","last_synced_at":"2025-06-17T20:42:31.589Z","repository":{"id":105100490,"uuid":"314943281","full_name":"tada-team/swap","owner":"tada-team","description":"Shortcuts for swapping variable values","archived":false,"fork":false,"pushed_at":"2022-02-20T16:06:22.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T22:42:01.165Z","etag":null,"topics":["go","golang","testing"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tada-team.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":"2020-11-22T02:23:33.000Z","updated_at":"2022-02-20T15:38:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"779f5bbe-454a-46cb-9aeb-1007b8476ce3","html_url":"https://github.com/tada-team/swap","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/tada-team/swap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tada-team%2Fswap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tada-team%2Fswap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tada-team%2Fswap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tada-team%2Fswap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tada-team","download_url":"https://codeload.github.com/tada-team/swap/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tada-team%2Fswap/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260439066,"owners_count":23009269,"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","golang","testing"],"created_at":"2024-12-02T14:18:05.709Z","updated_at":"2025-06-17T20:42:26.577Z","avatar_url":"https://github.com/tada-team.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# swap variables\n\n```go\n// myconfig.go\nvar myConfig struct {\n\tFoo string\n\tBar int\n}\n\nfunc init() {\n\treadConfig(\u0026myConfig)\n}\n```\n\n```go\n// test.go\nimport \"github.com/tada-team/swap\"\n\nfunc TestWithSwap(t *testing.T) {\n\tdefer swap.Value(\u0026myConfig.Foo, \"test value\")()\n\tdefer swap.Value(\u0026myConfig.Bar, 42)()\n\t// ...test cases...\n}\n\n// more sugar\nfunc TestWithSwapChain(t *testing.T) {\n\tdefer swap.Chain(\n\t\tswap.Value(\u0026myConfig.Foo, \"test value\"),\n\t\tswap.Value(\u0026myConfig.Bar, 42),\n\t)()  \n\t// ...test cases...\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftada-team%2Fswap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftada-team%2Fswap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftada-team%2Fswap/lists"}