
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
github.com/cweill/gotests
gotests
makes writing Go tests easy. It's a Golang commandline tool that generates table driven tests based on its target source files' function and method signatures. Any new dependencies in the test files are automatically imported.
The following shows gotests
in action using the official Sublime Text 3 plugin. Plugins also exist for Emacs, also Emacs, Vim, Atom Editor, Visual Studio Code, and IntelliJ Goland.
Minimum Go version: Go 1.6
Use go get
to install and update:
$ go get -u github.com/cweill/gotests/...
From the commandline, gotests
can generate Go tests for specific source files or an entire directory. By default, it prints its output to stdout
.
$ gotests [options] PATH ...
Available options:
-all generate tests for all functions and methods
-excl regexp. generate tests for functions and methods that don't
match. Takes precedence over -only, -exported, and -all
-exported generate tests for exported functions and methods. Takes
precedence over -only and -all
-i print test inputs in error messages
-only regexp. generate tests for functions and methods that match only.
Takes precedence over -all
-nosubtests disable subtest generation when >= Go 1.7
-parallel enable parallel subtest generation when >= Go 1.7.
-w write output to (test) files instead of stdout
-template_dir Path to a directory containing custom test code templates. Takes
precedence over -template. This can also be set via environment
variable GOTESTS_TEMPLATE_DIR
-template Specify custom test code templates, e.g. testify. This can also
be set via environment variable GOTESTS_TEMPLATE
-template_params_file read external parameters to template by json with file
-template_params read external parameters to template by json with stdin
Contributing guidelines are in CONTRIBUTING.md.
gotests
is released under the Apache 2.0 License.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.