gs-init
is a command-line tool for initializing Go projects. It is based on
the go-spring/skeleton project template, allowing you to quickly create a
well-structured Go project.
- Create projects based on the go-spring/skeleton template
- Automatically replace module name and package name
- Support specifying a Git branch
- Automatically generate project code
- Recommended way:
Use the gs integrated development tool.
- To install this tool individually:
go install github.com/go-spring/gs-init@latest
# Basic usage, module name is required
gs-init --module=github.com/your_name/your_project
# Specify a branch
gs-init --module=github.com/your_name/your_project --branch=main
--module
: Specify the project module name (required)--branch
: Specify the template branch to use, default ismain
- Clone the specified branch from the go-spring/skeleton repository
- Remove the
.git
directory to detach from the template repository - Replace placeholders in the template with the actual module name and package name
- Rename the project directory
- Run the
gs gen
command to generate project code
This project is licensed under the Apache License 2.0.