A Go project scaffolding tool that helps you quickly create well-structured Go projects.
- Multiple project templates (bare, CLI, web app, library)
- Customizable module path
- Best practices baked in (Makefile, .gitignore, .golangci.yml)
- Ready-to-use project structures
go install github.com/winterfx/wgo/cmd/wgo@latestwgo new <project-name> [flags]| Command | Description |
|---|---|
wgo new |
Create a new Go project |
wgo version |
Print version information |
| Flag | Short | Description |
|---|---|---|
--bare |
-b |
Simple project with just main.go and go.mod |
--cli |
-c |
Command-line tool with cobra structure |
--app |
-a |
Web service with layered architecture |
--lib |
-l |
Reusable library with examples |
| Flag | Short | Description |
|---|---|---|
--module |
-m |
Go module path (default: project name) |
# Create a simple project
wgo new myproject --bare
wgo new myproject -b
# Create a CLI tool
wgo new mycli --cli
wgo new mycli -c
# Create a web service
wgo new myapp --app
wgo new myapp -a
# Create a library
wgo new mylib --lib
wgo new mylib -l
# Specify module path
wgo new myapp --app --module github.com/yourname/myapp
wgo new myapp -a -m github.com/yourname/myapp
# Check version
wgo versionmyproject/
├── main.go
└── go.mod
mycli/
├── cmd/mycli/main.go
├── internal/commands/
│ ├── root.go
│ ├── init.go
│ └── version.go
├── tools/tools.go
├── Makefile
├── README.md
├── .gitignore
└── .golangci.yml
myapp/
├── cmd/server/main.go
├── api/v1/
│ ├── openapi.yaml
│ └── oapi-codegen.yaml
├── internal/
│ ├── api/
│ ├── handler/
│ ├── middleware/
│ ├── service/
│ ├── repository/
│ ├── infra/
│ └── config/
├── pkg/
├── configs/config.yaml
├── tools/tools.go
├── Dockerfile
├── docker-compose.yml
├── Makefile
├── README.md
├── .gitignore
└── .golangci.yml
mylib/
├── pkg/mylib/
│ ├── mylib.go
│ └── options.go
├── internal/
├── examples/basic/main.go
├── tools/tools.go
├── Makefile
├── README.md
├── LICENSE
├── .gitignore
└── .golangci.yml
make install-tools # Install goimports and golangci-lint| Command | Description |
|---|---|
make all |
Format, lint, test and build |
make fmt |
Format code with goimports |
make lint |
Run golangci-lint |
make test |
Run tests with race detection and coverage |
make build |
Build binary to ./bin/wgo |
make install |
Install to $GOBIN |
make run |
Run the application |
make clean |
Clean build artifacts |
make help |
Show available targets |
make build VERSION=1.0.0MIT