- Notifications
You must be signed in to change notification settings - Fork57
Go application GitHub repository template.
License
golang-templates/seed
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
⭐Star this repository if you find it valuable and worth maintaining.
👁Watch this repository to get notified about new releases, issues, etc.
This is a GitHub repository template for a Go application.You can use it:
- to create a new repository with automation and environment setup,
- as reference when improving automation for an existing repository.
It includes:
- continuous integration viaGitHub Actions,
- build automation viaMake,
- dependency management usingGo Modules,
- code formatting usinggofumpt,
- linting withgolangci-lintandmisspell,
- unit testing withrace detector,code coverageHTML reportandCodecov report,
- releasing usingGoReleaser,
- dependencies scanning and updating thanks toDependabot,
- security code analysis usingCodeQL Action,andgovulncheck,
- Visual Studio Code configuration withGo support.
- Sign up onCodecov and configureCodecov GitHub Application.
- Click the
Use this templatebutton (alt. clone or download this repository). - Replace all occurrences of
golang-templates/seedtoyour_org/repo_namein all files. - Replace all occurrences of
seedtorepo_nameinDockerfile. - Followtheseinstructions to add the
CODECOV_TOKENGitHub Actions and Dependabot secret. - Update the following files:
Below you can find sample instructions on how to set up the development environment.Of course, you can use other tools likeGoLand,Vim,Emacs.However, take notice that the Visual Studio Go extension isofficially supported by the Go team.
- InstallGo.
- InstallVisual Studio Code.
- InstallGo extension.
- Clone and open this repository.
F1->Go: Install/Update Tools-> (select all) -> OK.
make- execute the build pipeline.make help- print help for theMake targets.
F1 →Tasks: Run Build Task (Ctrl+Shift+B or ⇧⌘B) to execute the build pipeline.
The release workflow is triggered each time a tag withv prefix is pushed.
CAUTION: Make sure to understand the consequences before you bump the major version.More info:Go Wiki,Go Blog.
Notable files:
- .github/workflows - GitHub Actions workflows,
- .github/dependabot.yml - Dependabot configuration,
- .vscode - Visual Studio Code configuration files,
- .golangci.yml - golangci-lint configuration,
- .goreleaser.yml - GoReleaser configuration,
- Dockerfile - Dockerfile used by GoReleaser to create a container image,
- Makefile - Make targets used for development,CI build and.vscode/tasks.json,
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 officiallysupported by the Go team.
You can always remove the.vscode directory if it really does not help you.
GitHub Actions is out-of-the-box if you are already using GitHub.Here you can learn how to use it for Go.
However, changing to any other CI server should be very simple,because this repository has build logic and tooling installation inMakefile.
Installtdm-gccand copyC:\TDM-GCC-64\bin\mingw32-make.exetoC:\TDM-GCC-64\bin\make.exe.Alternatively, you may installmingw-w64and copymingw32-make.exe accordingly.
Take a lookhere,if you have problems using Docker in Git Bash.
You can also useWSL (Windows Subsystem for Linux)or develop inside aRemote Container.However, take into consideration that then you are not going to use "bare-metal" Windows.
Consider usinggoyekfor creating cross-platform build pipelines in Go.
Take a look at GoReleaserdocsas well asits repohow it is dogfooding its functionality.You can use it to add deb/rpm/snap packages, Homebrew Tap, Scoop App Manifest etc.
If you are developing a library and you like handcrafted changelog and release notes,you are free to remove any usage of GoReleaser.
Feel free to create an issue or propose a pull request.
Follow theCode of Conduct.
About
Go application GitHub repository template.
Topics
Resources
License
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.