Skip to content
/ wgo Public

A Go project scaffolding tool that helps you quickly create well-structured Go projects.

Notifications You must be signed in to change notification settings

winterfx/wgo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wgo

A Go project scaffolding tool that helps you quickly create well-structured Go projects.

Features

  • Multiple project templates (bare, CLI, web app, library)
  • Customizable module path
  • Best practices baked in (Makefile, .gitignore, .golangci.yml)
  • Ready-to-use project structures

Installation

go install github.com/winterfx/wgo/cmd/wgo@latest

Usage

wgo new <project-name> [flags]

Commands

Command Description
wgo new Create a new Go project
wgo version Print version information

Project Types

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

Options

Flag Short Description
--module -m Go module path (default: project name)

Examples

# 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 version

Generated Project Structures

--bare

myproject/
├── main.go
└── go.mod

--cli

mycli/
├── cmd/mycli/main.go
├── internal/commands/
│   ├── root.go
│   ├── init.go
│   └── version.go
├── tools/tools.go
├── Makefile
├── README.md
├── .gitignore
└── .golangci.yml

--app

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

--lib

mylib/
├── pkg/mylib/
│   ├── mylib.go
│   └── options.go
├── internal/
├── examples/basic/main.go
├── tools/tools.go
├── Makefile
├── README.md
├── LICENSE
├── .gitignore
└── .golangci.yml

Development

Prerequisites

make install-tools  # Install goimports and golangci-lint

Available Commands

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

Build with Version Info

make build VERSION=1.0.0

License

MIT

About

A Go project scaffolding tool that helps you quickly create well-structured Go projects.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •