Skip to content

orsenthil/goproject

Repository files navigation

Go Repository Template

This is a GitHub repository template for Go. It has been created for ease-of-use for anyone who wants to build binaries, Docker images, and publish Github releases.

It includes:

This work is based on the upstream Go Repository Template.

Usage

  1. Click the Use this template button (alt. clone or download this repository).
  2. Replace all occurences of jimmidyson/golang-repository-template to your_org/repo_name in all files.
  3. Rename folder cmd/seed to cmd/app_name and update .goreleaser.yml accordingly.
  4. Update LICENSE and README.md.

Build

  • Terminal: make to get help for make targets.
  • Visual Studio Code: TerminalRun Build Task... (CTRL+SHIFT+B) to execute a fast build.

Release

CAUTION: Make sure to understand the consequences before you bump the major version. More info: Go Wiki, Go Blog.

Maintainance

Remember to update Go version in devcontainer.json.

Notable files:

FAQ

Why Visual Studio Code editor configuration

Developers that use Visual Studio Code can take advantage of the editor configuration. While others do not have to care about it. Setting configs for each repo is unnecessary time consuming. VS Code is the most popular Go editor (survey) and it is officially supported by the Go team.

You can always remove the .devcontainer and .vscode directories if it really does not help you.

How can I create a Docker image, deb/rpm/snap package, Homebrew Tap, Scoop App Manifest etc.

Take a look at GoReleaser docs as well as its repo how it is dogfooding its functionality.

How can I create a library instead of an application

You can change the .goreleaser.yml to contain:

build:
  skip: true
release:
  github:
  prerelease: auto

Alternatively, you can completly remove the usage of GoReleaser if you prefer handcrafted release notes.

Contributing

Simply create an issue or a pull request.

About

A simple go project.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published