A minimal Go project template with automated linting configuration and task automation.
- 📝 golangci-lint Configuration - Auto-generated
.golangci.ymlbased on your module name - 🛠️ Task Automation - Pre-configured Taskfile with linting and formatting commands
- 🚀 Setup Scripts - Initialization script for quick project setup
-
Clone this template
git clone https://github.com/ASsssker/go-template.git <your-project-name> cd <your-project-name>
-
Initialize your Go module
go mod init github.com/yourusername/your-project-name
-
Run the initialization script
chmod +x scripts/init*.sh ./scripts/init.shThis will generate
.golangci.ymlconfiguration file based on your module name. -
Install linter tools
task linter:install
View all available commands:
task| Command | Description |
|---|---|
task linter:fmt |
Format Go files using gofumpt and gci |
task linter:lint |
Run golangci-lint |
task linter:lint:fix |
Run golangci-lint with automatic fixes |
task linter:install |
Install linting and formatting tools |
Running ./scripts/init.sh creates:
.golangci.yml- golangci-lint configuration with 60+ enabled linters, customized with your module name for import grouping
After setup, you can:
- Add your project structure (cmd/, internal/, pkg/, etc.)
- Start writing your Go code
- Use
task linter:fmtto format code - Use
task linter:lintto check for issues