Skip to content

veerendra2/go-project-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Project Template

Other references

Getting Started

Follow below steps after creating a new repository from this template

  • Initialize Go module:

    go mod init github.com/YOUR_USERNAME/YOUR_PROJECT_NAME
    go mod tidy
  • Update app name in:

  • Update main file location (if not using root main.go):

  • Configure Homebrew release (optional):

    Note: GitHub's default GITHUB_TOKEN has limited permissions for tap repositories. See GoReleaser docs.

  • Clean up: Delete this checklist and update README with project documentation

Build & Test

Install Taskfile: Installation Guide

# Available tasks
task --list
task: Available tasks for this project:
* all:                   Run comprehensive checks: format, lint, security and test
* build:                 Build the application binary for the current platform
* build-docker:          Build Docker image
* build-platforms:       Build the application binaries for multiple platforms and architectures
* fmt:                   Formats all Go source files
* install:               Install required tools and dependencies
* lint:                  Run static analysis and code linting using golangci-lint
* run:                   Runs the main application
* security:              Run security vulnerability scan
* test:                  Runs all tests in the project      (aliases: tests)
* vet:                   Examines Go source code and reports suspicious constructs

Install GoReleaser: Installation Guide

# Build locally
goreleaser release --snapshot --clean
...