Cover image for Useful Golang packages and tools

Useful Golang packages and tools

z0al profile image Ahmed T. Ali Originally published at Medium on ・3 min read

Cover image from: https://golang.org/doc/gopher/biplane.jpg

I recently built my first Go language program ever 🙌. In this post I would like to share some Go packages I found very useful.

So without further ado let’s get started :)


Building and distributing binaries for several platforms can be challenging. GoRelaeser helps you to automate delivering your app binaries with ease. It can generate archived release files (i.e. binaries + LICENSE + README files), checksums, Homebrew taps, Docker images, snap packages, release to GitHub (including the generating of customizable changelog 😃 ) and much more.

It works well with Travis and CircleCI, so you can automate almost everything 👌

🔗 http://github.com/goreleaser


Cobra is both a library for creating powerful modern CLI applications as well as a program to generate applications and command files. Cobra provides you everything you want to build awesome CLI, including sub-commands, automatic usage message, Pre and post run hooks, and generation of Man Page/Markdown/ResStructuredText docs.

Also, it provides automatic (without any configuration) suggestions when “unknown command” happens, e.g (yes, Hugo is powered by Cobra):

$ hugo srever
Error: unknown command "srever" for "hugo"

Did you mean this?

Run 'hugo --help' for usage.

🔗 https://github.com/spf13/cobra


Do you love Node.js inquirer package? if yes, then you will probably love Survey too. While it doesn’t support yet all the features provided by inquirer, it has all the basic features and very easy to usage.

Survey package in action

🔗 https://github.com/AlecAivazis/survey


Again, if you are familiar with npm packages like chalk, you will feel home here. Chalk is a go package for styling console/terminal output. like this:

🔗 https://godoc.org/github.com/ttacon/chalk


Probably is the smallest package of them all, but I find it really useful in git-related projects. It’s helpful when you want to extract some info from the global ~/.gitconfig or the local .git/config files. Here is a portion of the code I used to extract origin URL value to fetch remote issues from GitHub:

import (
    config "github.com/tcnksm/go-gitconfig"

remote := "origin"
url, err := config.Local(fmt.Sprintf("remote.%s.url", remote))

if err != nil {
    // .. print error
// use "url" value here to fetch from GitHub

🔗 https://github.com/tcnksm/go-gitconfig

Other link(s)

  1. A curated list of awesome Go frameworks, libraries and software
  2. List of useful(standard) go tools by @plutov
  3. My simple Git based To-Dos app written in Go

I hope you find this post useful. Thank you ;)

Originally posted on my blog

Posted on Dec 13 '17 by:

z0al profile

Ahmed T. Ali


I build various stuff using code, silly things mostly. In ❤ with Node.js, and Go.


markdown guide

Very useful post ! Thank you for sharing <3


Glad you find it useful, you're welcome :)


My first article that I added to the reading list on dev.to. Thanks for sharing these packages!