Skip to content

withsparkle/fiddle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Go Tool

Coverage Quality Documentation CI/CD Promo Mirror Template

🧩 Tool

Template for a typical CLI-tool written on Go.

πŸ›« Quick start

Work with Makefile
$ make setup
$ make help

$ make find-todos
$ make test lint
$ TIMEOUT=5s make test-with-coverage
Work with Taskfile
$ alias run=./Taskfile
$ 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
Work with Tools
$ make tools
$ source bin/activate

$ which goimports
$ goimports -local $(go list -m) -w ./...
Work with Docker
$ make go-1.19 # or go-1.20, etc.
/src# make go-env 2>/dev/null | grep GOVERSION
# GOVERSION:   1.19.10
/src# make test

πŸ’‘ Idea

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

$ tool do action

πŸ† Motivation

At OctoLab, 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 tool

  1. Generate a new repository from the template.
  2. Clone the repository locally.
  3. Update the desired files as needed.
  4. Write your code and tests.
  5. πŸš€

Contribute to the template

  1. Read the contribution guidelines.
  2. Fork 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, or if you find an issue, report it first.

πŸŽ›οΈ Configuration

Pre-configured

  1. GitHub Actions.
  2. GitHub Pages.
  3. Dependabot.

Included

  1. Nextra.
  2. Makefiles.
  3. Taskfiles.
  4. Go tools: mockgen, golangci-lint, godownloader, goreleaser, goimports, govulncheck.

Optional

  1. Bitbucket1.
  2. Codecov.
  3. Slack.
  4. Settings2.
  5. Go Report Card.
  6. Shields.io.
  7. GitHub Socialify.

Coming soon

  1. CodeQL (code scanning).
  2. Graphite (git workflow).
  3. Qodana (code quality).
  4. SonarCloud (code quality).
  5. Vanity URL (canonical import path).
  6. Vercel (docs preview).

πŸ›¬ Installation

Homebrew

$ brew install octolab/tap/tool

Binary

$ curl -fsSL https://install.octolab.org/octomation/tool | sh
# or
$ wget -qO-  https://install.octolab.org/octomation/tool | sh

Source

# use standard go tools
$ go get go.octolab.org/template/tool@latest
# or use egg tool
$ egg tools add go.octolab.org/template/tool@latest

Shell completions

$ tool completion > /path/to/completions/...
# or
$ source <(tool completion)

πŸ—οΈ Ecosystem

Input

Impact

Actions

🚧 Work in progress.

Custom forks

Output

made with ❀️ for everyone by OctoLab

Footnotes

  1. An alternative for backup could be GitLab, Gogs, or Gitea. ↩

  2. It has been deprecated and will be replaced someday by GitHub Actions. ↩