Go Module (opens in a new tab)

Coverage (opens in a new tab) Quality (opens in a new tab) Documentation (opens in a new tab) CI/CD (opens in a new tab) Promo (opens in a new tab) Mirror (opens in a new tab) Template (opens in a new tab)

🧩 Module awesome.icon (opens in a new tab)

Template for a typical module written on Go.

🛫 Quick start

Work with Makefile
$ make setup
$ make help
 
$ make find-todos
$ make test lint
$ TIMEOUT=5s make test-with-coverage

For more details please visit the page (opens in a new tab).

Work with Taskfile
$ alias run=./Taskfile
$ run refresh
$ run help
 
$ run docs # === `run docs install -- build -- start`
$ run docs npm ci
$ run docs npm i nextra@latest
 
$ run tools go generate tools.go
$ run tools golangci-lint --version -- mockgen --version
$ run which goimports golangci-lint govulncheck mockgen

For more details please visit the page (opens in a new tab).

Work with tools
$ make tools
$ source bin/activate
 
$ which goimports
$ goimports -local $(go list -m) -w ./...

For more details please visit the page (opens in a new tab).

Work with Docker
$ make go-1.11 # or go-1.12, etc.
/src# make go-env 2>/dev/null | grep GOVERSION
# GOVERSION:   1.11.13
/src# make test
🚧 Work with documentation

💡 Idea

Define a powerful template that quickly creates a new Go module. Not only does it provide a starting point for new projects, but it comes equipped with pre-configured ci/cd and inventory.

🏆 Motivation

At OctoLab (opens in a new tab), we want to start new projects faster using best practices with a predefined structure and focusing on core ideas implementation rather than wasting time on environment configuration and copying boilerplate code.

🤼‍ How to

Build your own module

  1. Generate (opens in a new tab) a new repository from the template.
  2. Clone the repository locally.
  3. Update the desired files as needed, e.g., run init my.new/module.
  4. Write your code and tests.
  5. 🚀

Contribute to the template

  1. Read the contribution guidelines (opens in a new tab).
  2. Fork (opens in a new tab) the repository.
  3. Make your changes.
  4. Send a pull request.
  5. 🤗

Before you start, please make sure your changes are in demand. The best for that is to create a new discussion (opens in a new tab), or if you find an issue, report it (opens in a new tab) first.

🎛️ Configuration

Pre-configured

  1. GitHub Actions (opens in a new tab).
  2. GitHub Pages (opens in a new tab).
  3. Dependabot (opens in a new tab).

Included

  1. Nextra (opens in a new tab).
  2. Makefiles (opens in a new tab).
  3. Taskfiles (opens in a new tab).
  4. Go tools (opens in a new tab): mockgen (opens in a new tab), golangci-lint (opens in a new tab), goimports (opens in a new tab), govulncheck (opens in a new tab).

Optional

  1. Bitbucket (opens in a new tab)1.
  2. Cloudflare Pages (opens in a new tab)2.
  3. Codecov (opens in a new tab).
  4. GitHub Socialify (opens in a new tab).
  5. Go Report Card (opens in a new tab).
  6. Settings (opens in a new tab)3.
  7. Shields.io (opens in a new tab).
  8. Slack (opens in a new tab).
  9. Vanity URL (opens in a new tab).

Coming soon

  1. CodeQL (opens in a new tab) (code scanning).
  2. Graphite (opens in a new tab) (git workflow).
  3. Qodana (opens in a new tab) (code quality).
  4. SonarCloud (opens in a new tab) (code quality).
  5. Vercel (opens in a new tab) (docs preview).

🛬 Integration

The project uses SemVer (opens in a new tab) for versioning, and it is not BC (opens in a new tab)-safe through major releases. Please use Go Modules (opens in a new tab) to manage its version.

$ go get go.octolab.org@latest

🏗️ Ecosystem

Input

Impact

Output

made with ❤️ for everyone by OctoLab

Footnotes

  1. An alternative for backup could be GitLab (opens in a new tab), Gogs (opens in a new tab), or Gitea (opens in a new tab).

  2. Useful for private repositories.

  3. It has been deprecated and will be replaced someday by GitHub Actions (opens in a new tab).