{"id":16434394,"url":"https://github.com/tommylemon/unitauto-go","last_synced_at":"2025-03-21T04:32:44.967Z","repository":{"id":125454234,"uuid":"610744322","full_name":"TommyLemon/unitauto-go","owner":"TommyLemon","description":"UnitAuto - ☀️ 最先进、最省事、ROI 最高的单元测试，机器学习 零代码、全方位、自动化 测试 方法/函数，用户包含腾讯、快手、某 500 强巨头等，本项目为 Go 版 ☀️ The most advanced unit testing way powered by machine learning. Coding-free, comprehensive and automatic testing for methods/functions. Used by Tencent, Kwai, a Fortune 500 company, etc. This repo is the Go version","archived":false,"fork":false,"pushed_at":"2024-04-14T15:03:20.000Z","size":38647,"stargazers_count":38,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-12T08:49:00.995Z","etag":null,"topics":["automation","go","golang","golang-library","mock","mocking-library","test-automation","testing","testing-automation","unit-test","unit-testing","unittest","unittesting","ut"],"latest_commit_sha":null,"homepage":"http://apijson.cn/unit?language=Go","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TommyLemon.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":"2023-03-07T11:52:28.000Z","updated_at":"2024-08-18T14:27:58.000Z","dependencies_parsed_at":"2023-12-24T11:29:53.445Z","dependency_job_id":"ff3fd71a-9276-4361-a346-c78435163dc2","html_url":"https://github.com/TommyLemon/unitauto-go","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TommyLemon%2Funitauto-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TommyLemon%2Funitauto-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TommyLemon%2Funitauto-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TommyLemon%2Funitauto-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TommyLemon","download_url":"https://codeload.github.com/TommyLemon/unitauto-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221811460,"owners_count":16884335,"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":["automation","go","golang","golang-library","mock","mocking-library","test-automation","testing","testing-automation","unit-test","unit-testing","unittest","unittesting","ut"],"created_at":"2024-10-11T08:49:01.911Z","updated_at":"2024-10-28T09:24:54.576Z","avatar_url":"https://github.com/TommyLemon.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# unitauto-go \nUnitAuto Go 库，可通过 GitHub 仓库等远程依赖。\u003cbr /\u003e\nUnitAuto Go Library for remote dependencies with GitHub repo, etc.\n\n\u003cimg width=\"1495\" alt=\"image\" src=\"https://user-images.githubusercontent.com/5738175/225639582-76f8cf99-d603-4d93-ae19-77b9fd278a42.png\"\u003e\n\n同步纯函数：\u003cbr /\u003e\nSync pure function: \u003cbr /\u003e\nhttps://github.com/TommyLemon/unitauto-go/blob/main/unitauto/test/test_util.go#L25-L27\n\u003cimg width=\"1495\" alt=\"image\" src=\"https://user-images.githubusercontent.com/5738175/225637162-779e64ee-46f8-41a0-b91a-c0e66d291398.png\"\u003e\n\nstruct 成员函数：\u003cbr /\u003e\nstrcut member function: \u003cbr /\u003e\nhttps://github.com/TommyLemon/unitauto-go/blob/main/unitauto/test/test_util.go#L88-L90\n\u003cimg width=\"1495\" alt=\"image\" src=\"https://user-images.githubusercontent.com/5738175/225635650-f776dc3a-596c-4796-95d7-1ca1c2f02782.png\"\u003e\n\u003cimg width=\"1495\" alt=\"image\" src=\"https://user-images.githubusercontent.com/5738175/225635800-5909dfb7-17c1-45e2-94e5-7c2251aa4500.png\"\u003e\n\n协程异步函数：\u003cbr /\u003e\ngoroutine function: \u003cbr /\u003e\nhttps://github.com/TommyLemon/unitauto-go/blob/main/unitauto/test/test_util.go#L33-L45\n\u003cimg width=\"1495\" alt=\"image\" src=\"https://user-images.githubusercontent.com/5738175/225636134-a4daf4ec-9304-44d2-b09a-28497c815188.png\"\u003e\n\n异步回调函数：\u003cbr /\u003e\nasync callback function: \u003cbr /\u003e\nhttps://github.com/TommyLemon/unitauto-go/blob/main/unitauto/test/test_util.go#L72-L81\n\u003cimg width=\"1495\" alt=\"image\" src=\"https://user-images.githubusercontent.com/5738175/225636569-b508fa19-3973-4655-bd49-68742c4d09d0.png\"\u003e\n\n\u003cbr /\u003e\n\n代码覆盖率统计：\u003cbr /\u003e\nCode coverage: \u003cbr /\u003e\nhttps://github.com/qiniu/goc/issues/349\n\u003cimg width=\"1495\" alt=\"image\" src=\"https://github.com/qiniu/goc/assets/5738175/77ed49f9-aa18-4cc9-82b8-31b7cba107b7\"\u003e\n\u003cimg width=\"1495\" alt=\"image\" src=\"https://github.com/qiniu/goc/assets/5738175/07a8c278-980f-4b4f-96c4-df96f4f26a17\"\u003e\n\n\u003cbr /\u003e\n\n**Demo:** https://github.com/TommyLemon/unitauto-go-demo\n\n\u003cbr /\u003e\n\n#### 1. 在 go.mod 中添加 GitHub 仓库\n#### 1. Add the GitHub repository to go.mod\n```go\n\trequire (\n\t\tgithub.com/TommyLemon/unitauto-go v1.0.0\n\t)\n```\n\u003cbr /\u003e\n\n#### 2. 执行 go get 命令\n#### 2. Run go get command\n```sh\n\tgo get github.com/TommyLemon/unitauto-go@v1.0.0\n```\n\u003cbr /\u003e\n\n#### 3. 启动单元测试服务\n#### 3. Start unit testing server\nhttps://github.com/TommyLemon/unitauto-go/blob/main/main.go#L7-L12\n```go\nfunc main() {\n\tunitauto.Start(8082)\n}\n```\n\n\u003cbr /\u003e\n\n#### 4. 参考主项目文档来测试\n#### 4. Test by following the main repo\n\nhttps://github.com/TommyLemon/UnitAuto\n\n由于 Go 的反射限制，目前做不到像 Java, Kotlin 版几乎绝对零代码，还需要注册 func 和 struct 的实例，\u003cbr /\u003e\n不过注册代码可以通过 UnitAuto-Admin 前端管理网页设置项 \\[查看、同步方法文档] 来生成，复制粘贴到被测项目中：\u003cbr /\u003e\nDue to the limitation of Go, it's not almost absolutely coding free like Java and Kotlin, \u003cbr /\u003e\nand you need to write few code to register the funcs and structs to be tested. \u003cbr /\u003e\nHowever, the code can be generated by clicking the setting item [View/Sync doc] of UnitAuto-Admin, \u003cbr /\u003e\nthen you can copy and pasted the \"ginCode\" into the project under test instead of coding: \u003cbr /\u003e\n\nhttps://github.com/TommyLemon/unitauto-go/blob/main/main.go\n\u003cimg width=\"1495\" alt=\"image\" src=\"https://user-images.githubusercontent.com/5738175/225632360-ce953a58-22b1-4b4e-8b3d-0083edebc71a.png\"\u003e\n\u003cimg width=\"1495\" alt=\"image\" src=\"https://user-images.githubusercontent.com/5738175/225635146-f8dab9d1-76c5-421a-b45e-732e4923fd4d.png\"\u003e\n\n\u003cbr /\u003e\n\n### 5. 关于作者\n### 5. Author\n[https://github.com/TommyLemon](https://github.com/TommyLemon) \u003cbr /\u003e\n\u003cimg width=\"1280\" src=\"https://github.com/TommyLemon/UIGO/assets/5738175/ec77df98-ff9b-43aa-b2f1-2fce2549d276\"\u003e\n\n如果有什么问题或建议可以 [去 APIAuto 提 issue](https://github.com/TommyLemon/APIAuto/issues)，交流技术，分享经验。\u003cbr \u003e\n如果你解决了某些 bug，或者新增了一些功能，欢迎 [提 PR 贡献代码](https://github.com/Tencent/APIJSON/blob/master/CONTRIBUTING.md)，感激不尽。\n\u003cbr /\u003e\nIf you have any questions or suggestions, you can [create an issue](https://github.com/TommyLemon/APIAuto/issues). \u003cbr \u003e\nIf you can added a feature or fixed a bug, please [create a pull request](https://github.com/TommyLemon/unitauto-go/pulls), thank you~\n\n\n### 6. 其它项目\n### 6. Link\n创作不易、坚持更难，右上角点 ⭐ Star 支持下吧，谢谢 ^\\_^ \u003cbr /\u003e\nPlease ⭐ Star the repos that you like ^\\_^ \u003cbr /\u003e\n\n[UnitAuto](https://github.com/TommyLemon/UnitAuto) 机器学习零代码单元测试平台，零代码、全方位、自动化 测试 方法/函数 的正确性、可用性和性能\n\n[unitauto-go-demo](https://github.com/TommyLemon/unitauto-go-demo) UnitAuto Go Demo，提供用来做单元测试的业务函数\n\n[unitauto-py](https://github.com/TommyLemon/unitauto-py) UnitAuto Python 库，可通过 pip 仓库等远程依赖\n\n[APIJSON](https://github.com/Tencent/APIJSON) 🚀 腾讯零代码、全功能、强安全 ORM 库 🏆 后端接口和文档零代码，前端(客户端) 定制返回 JSON 的数据和结构\n\n[apijson-go](https://github.com/glennliao/apijson-go) Go 版 APIJSON， 基于Go(\u003e=1.18) + GoFrame2, 支持查询、单表增删改、权限管理等\n\n[APIAuto](https://github.com/TommyLemon/APIAuto) 敏捷开发最强大易用的 HTTP 接口工具，机器学习零代码测试、生成代码与静态检查、生成文档与光标悬浮注释，集 文档、测试、Mock、调试、管理 于一体的一站式体验\n\n[SQLAuto](https://github.com/TommyLemon/SQLAuto) 智能零代码自动化测试 SQL 语句执行结果的数据库工具，任意增删改查、任意 SQL 模板变量、一键批量生成参数组合、快速构造大量测试数据\n\n[UIGO](https://github.com/TommyLemon/UIGO) 📱 零代码快准稳 UI 智能录制回放平台 🚀 自动兼容任意宽高比分辨率屏幕，自动精准等待网络请求，录制回放快、准、稳！\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftommylemon%2Funitauto-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftommylemon%2Funitauto-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftommylemon%2Funitauto-go/lists"}