Skip to content
/ GoSeed Public template
generated from golang-templates/seed

Small template for making "good" Go repos!

License

Notifications You must be signed in to change notification settings

zdylag/GoSeed

Repository files navigation

Go Repository Template

Keep a Changelog GitHub Release Go Reference go.mod LICENSE Build Status Go Report Card Codecov

Example use of the go test repository!

Setup

Below you can find sample instructions on how to set up the development environment. Of course you can use other tools like GoLand, Vim, Emacs. However take notice that the Visual Studio Go extension is officially supported by the Go team.

Local Machine

Follow these steps if you are OK installing and using Go on your machine.

  1. Install Go.
  2. Install Visual Studio Code.
  3. Install Go extension.
  4. Clone and open this repository.
  5. F1 -> Go: Install/Update Tools -> (select all) -> OK.

Development Container

Follow these steps if you do not want to install Go on your machine and you prefer to use a Development Container instead.

  1. Install Visual Studio Code.
  2. Follow Developing inside a Container - Getting Started.
  3. Clone and open this repository.
  4. F1 -> Remote-Containers: Reopen in Container.
  5. F1 -> Go: Install/Update Tools -> (select all) -> OK.

The Development Container configuration mixes Docker in Docker and Go definitions. Thanks to it you can use go, docker, docker-compose inside the container.

Build

Terminal

  • make - execute the build pipeline.
  • make help - print help for the Make targets.

Visual Studio Code

F1Tasks: Run Build Task (Ctrl+Shift+B or ⇧⌘B) to execute the build pipeline.

Release

The release workflow is triggered each time a tag with v prefix is pushed.

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

How to automate generating git tags for next release version

Auto-tagging can be done in many ways e.g. by using GitHub Actions like:

However, creating a release tag manually is often the optimal approach. Take notice that this template executes a release workflow each time a git tag with v prefix is pushed.

Contributing

Simply create an issue or a pull request.