Skip to content

star-light-nova/go-gentest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo

Go Gentest

Go Generate Test. It generates _test.go files for each .go file in the current directory.

Content

Introduction

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.

Prerequisites

  • Go >= 1.21.3

Installation

Using bash

cd &&
git clone git@github.com:star-light-nova/go-gentest.git &&
cd gentest &&
go build &&
go install

Flags

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.

List of flags

  1. dry-run - Outputs everything in the terminal instead of creating _test.go files.

    gentest start --dry-run
  2. test-folder - Generates _test.go files in the specified folder in accordance of the original files' path.

    gentest start --test-folder=test	
  3. test-only - Generates _test.go file, only for one specified file

    gentest start --test-only=path/to/file.go

Further improvement

Nothing is perfect, so try to contribute something in here if you have a free time. Link to the project

About

It will generate `_test.go` files for you.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages