goup
is a CLI tool designed to help developers quickly initialize and manage Go projects with ease. It automates the setup process, including the creation of Go modules, tidying up dependencies, and setting up an initial main.go
file. Whether you're starting a new Go project or managing existing ones, goup
simplifies the process.
To install goup
via Homebrew, simply run the following command:
% brew install RyotaroSeto/tap/goup
This will download and install goup
onto your system, making it available as a global command.
To upgrade goup
to the latest version, use the following command:
% brew upgrade RyotaroSeto/tap/goup
Here is how you can use goup
to initialize a new Go project:
- Initialize a new Go project by running the following command:
% goup init <project-name>
This will:
- Run
go mod init <project-name>
to initialize the Go module. - Run
go mod tidy
to clean up and synchronize dependencies. - Create a basic
main.go
file with a "Hello, World!" example.
To run all tests in the project with verbose output and coverage reporting, use the test command:
% goup test
This will:
- Run all tests in the current project with verbose output (
-v
) and generate a test coverage report (-cover
).
You can also run a specific test function using the --run
flag:
% goup test --run <test-function>
This will only run the TestExample
function.
To run all benchmark tests in the project, use the following command:
% goup benchmark
This will run all the benchmarks in the current project. You can also specify a specific benchmark function using the --bench
flag:
% goup benchmark --bench <benchmark-function>
% goup init my-new-project
This will create a new Go project named my-new-project
with the necessary setup files.
% goup test
This will run all the tests in the project with detailed output and coverage information.
% goup test --run TestExample
This will run only the TestExample
test function.
% goup benchmark
This will run all the benchmarks in the project.
% goup benchmark --bench BenchmarkSort
This will run only the BenchmarkSort
benchmark function.