{"id":13393976,"url":"https://github.com/cweill/gotests","last_synced_at":"2025-05-12T20:48:12.494Z","repository":{"id":37545848,"uuid":"49927767","full_name":"cweill/gotests","owner":"cweill","description":"Automatically generate Go test boilerplate from your source code.","archived":false,"fork":false,"pushed_at":"2023-09-12T00:02:48.000Z","size":12848,"stargazers_count":5058,"open_issues_count":63,"forks_count":345,"subscribers_count":79,"default_branch":"develop","last_synced_at":"2025-04-23T17:48:42.582Z","etag":null,"topics":["code-generator","commandline","go","go-test","go-testing","golang","golang-application","golang-testing","golang-tools","gotests","table-driven-test","table-driven-testing","test-driven-development","test-generation","testing","testing-golang","testing-tools"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"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/cweill.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-01-19T05:06:02.000Z","updated_at":"2025-04-23T02:26:16.000Z","dependencies_parsed_at":"2023-02-01T02:31:08.803Z","dependency_job_id":"d1d5e6fd-2d3a-4a42-af9d-ac63d4542c2c","html_url":"https://github.com/cweill/gotests","commit_stats":{"total_commits":338,"total_committers":30,"mean_commits":"11.266666666666667","dds":0.5887573964497042,"last_synced_commit":"16a93f6eb6519118b1d282e2f233596a98dd7e96"},"previous_names":["cweill/go-gentests"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cweill%2Fgotests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cweill%2Fgotests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cweill%2Fgotests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cweill%2Fgotests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cweill","download_url":"https://codeload.github.com/cweill/gotests/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253819775,"owners_count":21969426,"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":["code-generator","commandline","go","go-test","go-testing","golang","golang-application","golang-testing","golang-tools","gotests","table-driven-test","table-driven-testing","test-driven-development","test-generation","testing","testing-golang","testing-tools"],"created_at":"2024-07-30T17:01:04.305Z","updated_at":"2025-05-12T20:48:12.475Z","avatar_url":"https://github.com/cweill.png","language":"Go","readme":"# gotests [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/cweill/gotests/blob/master/LICENSE) [![godoc](https://img.shields.io/badge/go-documentation-blue.svg)](https://godoc.org/github.com/cweill/gotests) [![Build Status](https://github.com/cweill/gotests/workflows/Go/badge.svg)](https://github.com/cweill/gotests/actions) [![Coverage Status](https://coveralls.io/repos/github/cweill/gotests/badge.svg?branch=master)](https://coveralls.io/github/cweill/gotests?branch=master) [![codebeat badge](https://codebeat.co/badges/7ef052e3-35ff-4cab-88f9-e13393c8ab35)](https://codebeat.co/projects/github-com-cweill-gotests) [![Go Report Card](https://goreportcard.com/badge/github.com/cweill/gotests)](https://goreportcard.com/report/github.com/cweill/gotests)\n\n`gotests` makes writing Go tests easy. It's a Golang commandline tool that generates [table driven tests](https://github.com/golang/go/wiki/TableDrivenTests) based on its target source files' function and method signatures. Any new dependencies in the test files are automatically imported.\n\n## Demo\n\nThe following shows `gotests` in action using the [official Sublime Text 3 plugin](https://github.com/cweill/GoTests-Sublime). Plugins also exist for [Emacs](https://github.com/damienlevin/GoTests-Emacs), also [Emacs](https://github.com/s-kostyaev/go-gen-test), [Vim](https://github.com/buoto/gotests-vim), [Atom Editor](https://atom.io/packages/gotests), [Visual Studio Code](https://github.com/Microsoft/vscode-go), and [IntelliJ Goland](https://www.jetbrains.com/help/go/run-debug-configuration-for-go-test.html).\n\n![demo](https://github.com/cweill/GoTests-Sublime/blob/master/gotests.gif)\n\n## Installation\n\n__Minimum Go version:__ Go 1.6\n\nUse [`go get`](https://golang.org/cmd/go/#hdr-Download_and_install_packages_and_dependencies) to install and update:\n\n```sh\n$ go get -u github.com/cweill/gotests/...\n```\n\n## Usage\n\nFrom the commandline, `gotests` can generate Go tests for specific source files or an entire directory. By default, it prints its output to `stdout`.\n\n```sh\n$ gotests [options] PATH ...\n```\n\nAvailable options:\n\n```\n  -all                  generate tests for all functions and methods\n\n  -excl                 regexp. generate tests for functions and methods that don't\n                         match. Takes precedence over -only, -exported, and -all\n\n  -exported             generate tests for exported functions and methods. Takes\n                         precedence over -only and -all\n\n  -i                    print test inputs in error messages\n\n  -only                 regexp. generate tests for functions and methods that match only.\n                         Takes precedence over -all\n\n  -nosubtests           disable subtest generation when \u003e= Go 1.7\n\n  -parallel             enable parallel subtest generation when \u003e= Go 1.7.\n\n  -w                    write output to (test) files instead of stdout\n\n  -template_dir         Path to a directory containing custom test code templates. Takes\n                         precedence over -template. This can also be set via environment\n                         variable GOTESTS_TEMPLATE_DIR\n\n  -template             Specify custom test code templates, e.g. testify. This can also\n                         be set via environment variable GOTESTS_TEMPLATE\n\n  -template_params_file read external parameters to template by json with file\n\n  -template_params      read external parameters to template by json with stdin\n```\n\n## Contributions\n\nContributing guidelines are in [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## License\n\n`gotests` is released under the [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0).\n","funding_links":[],"categories":["Go Generate Tools","Go","开源类库","Misc","Open source library","Containers \u0026 Language Extentions \u0026 Linting","Go 生成工具","testing","Go生成工具","Go 代码生成工具","Libraries for creating HTTP middlewares"],"sub_categories":["Routers","测试","Test","For Go","路由器","代码分析"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcweill%2Fgotests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcweill%2Fgotests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcweill%2Fgotests/lists"}