Skip to content

Molov30/go-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Project Template

A minimal Go project template with automated linting configuration and task automation.

What's Included

  • 📝 golangci-lint Configuration - Auto-generated .golangci.yml based on your module name
  • 🛠️ Task Automation - Pre-configured Taskfile with linting and formatting commands
  • 🚀 Setup Scripts - Initialization script for quick project setup

Quick Start

Prerequisites

  • Go 1.21 or higher
  • Task - Task runner

Setup

  1. Clone this template

    git clone https://github.com/ASsssker/go-template.git <your-project-name>
    cd <your-project-name>
  2. Initialize your Go module

    go mod init github.com/yourusername/your-project-name
  3. Run the initialization script

    chmod +x scripts/init*.sh
    ./scripts/init.sh

    This will generate .golangci.yml configuration file based on your module name.

  4. Install linter tools

    task linter:install

Available Commands

View all available commands:

task

Linter Commands

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

What Gets Generated

Running ./scripts/init.sh creates:

  • .golangci.yml - golangci-lint configuration with 60+ enabled linters, customized with your module name for import grouping

Next Steps

After setup, you can:

  1. Add your project structure (cmd/, internal/, pkg/, etc.)
  2. Start writing your Go code
  3. Use task linter:fmt to format code
  4. Use task linter:lint to check for issues

About

Go template with golangci-lint and task automation

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages