Go Generate Test. It generates
_test.go
files for each.go
file in the current directory.
Why this project exist? To provide the way to generate _test.go
files to brogrammers that got tired of writing the same thing again and again.
- Go >= 1.21.3
cd &&
git clone git@github.com:star-light-nova/go-gentest.git &&
cd gentest &&
go build &&
go install
The flags are needed to get control over the generator. For example, if you don't want to create tons of files, you can use --dry-run
flag, that will output to your terminal, instead of creating _test.go
files.
-
dry-run
- Outputs everything in the terminal instead of creating_test.go
files.gentest start --dry-run
-
test-folder
- Generates_test.go
files in the specified folder in accordance of the original files' path.gentest start --test-folder=test
-
test-only
- Generates_test.go
file, only for one specified filegentest start --test-only=path/to/file.go
Nothing is perfect, so try to contribute something in here if you have a free time. Link to the project