This is a
GitHub repository template for Golang.
It has been created for ease of use for anyone who wants to:
- quickly get into Go without losing too much time on environment setup,
- create a new repository with essential Continous Integration.
It includes:
- continuous-integration via GitHub Actions,
- dependency management using Golang Modules,
- code formatting using gofumpt,
- linting with golangci-lint,
- build automation via Make,
- unit testing with testify, race detector, code coverage HTML report and Codecov report,
- releasing using GoReleaser,
- dependencies scanning and updating thanks to Dependabot,
- security code analysis using CodeQL Action,
- Visual Studio Code configuration with Go and Remote Container support.
Star
this repository if you find it valuable and worth maintaining.
Watch
this repository to get notified about new releases, issues, etc.
Golang Project Template Usage
- Sign up on Codecov and configure Codecov GitHub Application for all repositories.
- Click the
Use this template
button (alt. clone or download this repository). - Replace all occurrences of golang-templates/seed with your_org/repo_name in all files.
- Replace all occurrences of
seed
torepo_name
in Dockerfile. - Update the following files:
- CHANGELOG.md
- CODE_OF_CONDUCT.md
- LICENSE
- README.md
Setup the Golang Development Environment
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 Go team officially supports the Visual Studio Go extension.
Local Machine
Follow these steps if you are OK installing and using Go on your machine.
- Install Go.
- Install Visual Studio Code.
- Install Go extension.
- Clone and open this repository.
F1
->Go: Install/Update Tools
-> (select all) -> OK.
Golang Development Container
Follow these steps if you do not want to install Golang on your machine and you prefer to use a Development Container instead.
There is no ads to display, Please add some