Go Template

screenshot of Go Template

A batteries-included project generator for your next Go project :rocket:

Overview

Go-template is a bleeding-edge Go project generator that allows users to quickly set up and configure new Go projects. It provides a batteries-included cookiecutter template with all the essential features and tools needed for Go development. With automated code formatting, pre-commit setups, security checks, code duplication checks, and more, go-template makes it easy to enforce good programming practices and ensure code quality. It also includes deployment and release management capabilities, as well as community features such as pull request and issue templates.

Features

  • Development:

    • Support for Go v1.19, v1.20, and v1.21
    • Automated code formatting with gofmt and gofumpt
    • Sorting imports with goimports and gci
    • Pre-commit setup with various hooks configured in .pre-commit-config.yaml
    • Security checks with gosec, code duplication checks with dupl, and magic number checks with go-mnd
    • Configured .editorconfig, .dockerignore, and .gitignore files
  • Code Quality and Linting:

    • Enforce good programming practices with go-critic, gocyclo, gocognit, and stylecheck
    • Code linting with golangci-lint and a ready-to-use .golangci.yml configuration file
  • Testing and Coverage:

    • Easy setup with Makefile for running linters, checking code style, running tests, and generating coverage reports with a single command
    • Multiple test modes supported by the Makefile to run tests as frequently as needed, without running long tests every time
  • Deployment:

    • Github Actions with predefined workflows, including CI/CD, release drafter, and optional code coverage with Codecov
    • Manual execution of Github actions if needed
    • Dockerfile with multi-stage build for containerizing apps with minimal image sizes
    • Automatic dependency updates with @Dependabot
  • Release Management and Community:

    • Generation of pull request and issue templates
    • Automatic generation of files like LICENSE, CONTRIBUTING.md, CODE_OF_CONDUCT.md, and SECURITY.md
    • Semantic versioning with Release Drafter
    • Fork friendly project generation using relative links to ensure no confusion among users

Summary

Go-template is a powerful Go project generator that offers a comprehensive set of features and tools to streamline Go development. With its batteries-included cookiecutter template, developers can quickly set up new projects with essential configurations and best practices. From automated code formatting, pre-commit setups, and code quality checks to deployment workflows, release management, and community templates, go-template covers all aspects of modern Go project development.

template
Templates & Themes

A template or theme refers to a pre-designed layout or structure that provides a basic framework for building a specific type of application or website. It typically includes good design, placeholder content and functional features, allowing developers to customize and fill in the details according to their specific needs.