Cobra

FreeGogithub.com

Best for: Building CLIs in Go

Overview

Library for building command-line apps in Go, with subcommands, flags and generated help. Used by kubectl, Hugo and the GitHub CLI.

Strengths

  • Subcommands and help generated
  • Proven in big CLIs

Drawbacks

  • Heavy for a tiny script

Alternatives to Cobra

See all 9 →

A Tour of Go

Your first day with Go
Free

The official interactive Go introduction: run and edit code in the browser while it walks through syntax, methods, interfaces and concurrency.

Go by Example

Looking up how to do X in Go
Free

Short annotated Go programs, one per topic, from basics to goroutines, channels and testing.

Effective Go

Writing Go the way the Go team does
Free

The Go team's guide to writing idiomatic Go: naming, formatting, errors, interfaces and concurrency.