Skip to content

FAQ

Frequently asked questions

Quick answers about installing goclean, the stack it generates and how it fits into your workflow.

The basics

What is goclean?

goclean is an open-source command-line tool that scaffolds structured Go backend projects using Clean Architecture. One command gives you the layers, wiring, configuration, Docker files and tooling already in place.

Read the introduction
Is goclean free?

Yes. goclean is MIT licensed, free to use in personal and commercial projects, and developed in the open on GitHub.

Why use Clean Architecture in Go?

Clean Architecture keeps business rules independent of frameworks and databases. Dependencies point inward toward the domain, so you can test usecases in isolation and swap an HTTP framework or database without rewriting core logic.

See the four layers
How is goclean different from copying a template repository?

A template needs manual renaming and cleanup, and it cannot grow with your app. goclean asks for your stack, generates a project with your module path, and then keeps generating new modules (entity, DTOs, repository, usecase, handler, migration and routes) that match the same structure.

Installing and using it

How do I install goclean?

On Linux and macOS run the install script, on Windows run the PowerShell script, or use go install. You can also download a release archive manually. Every release publishes a checksums.txt file.

Installation guide
Do I need Go installed to use goclean?

Not to install the binary. You do need Go 1.23 or newer to build and run the projects it generates. Run goclean doctor to check that Go, git and Docker are present and recent enough.

Which operating systems are supported?

Linux, macOS and Windows, on both amd64 and arm64.

How do I create my first project?

Run goclean new my-app, then goclean make:module Product name:string price:float to generate your first feature module. Start the server with Air for hot reload.

Quick Start
Can I preview what goclean will generate?

Yes. Add --dry-run to any command to list the files it would create without writing anything. Use --force only when you want to overwrite existing files.

Command reference

Stack and features

Should I choose Gin or Chi?

Both are supported through the --router flag, and Gin is the default. Gin is popular and batteries-included; Chi is lightweight and close to the standard library. Because handlers live in the delivery layer, the choice does not leak into your business logic.

Which databases and ORMs are supported?

PostgreSQL, MySQL and SQLite, all through GORM. Database access is isolated in the infrastructure layer, and usecases only see repository interfaces.

Database setup
What else is included in a generated project?

Viper configuration, Zerolog structured logging, graceful shutdown, a working User feature with a health endpoint, middleware, migrations, a Docker Compose file for PostgreSQL and MySQL, Air hot reload and a Makefile.

Project structure
What does make:module generate?

For each module it generates the domain entity and repository interface, the usecase, DTOs, handler and route registration, the GORM repository, and a migration. Use --no-register if you do not want goclean to patch container.go and routes.go.

Module generation
Can I generate only one piece, like a handler or a migration?

Yes. The single-piece generators are make:entity, make:types, make:repo, make:usecase, make:handler and make:migration.

Deploying and getting help

Can I deploy a goclean project to production?

Yes. The generated server shuts down gracefully, so it fits container platforms and orchestrators. goclean does not generate a Dockerfile, so add your own. Provide secrets through your platform and run migrations before starting a new version.

Deployment checklist
I get "goclean: command not found". What do I do?

The Go bin directory is probably not on your PATH. Add $(go env GOPATH)/bin to it, or restart your terminal after using the Windows installer.

Troubleshooting
How do I upgrade goclean?

Run the install command again. It always fetches the newest release. See the changelog for what changed.

Changelog
How can I report a bug or contribute?

Open an issue or pull request on GitHub. Bug reports, ideas and improvements are welcome.

Still have a question?

Check the documentation, or ask on GitHub and we will help.