DEV Community

Cover image for Useful Golang packages and tools

Posted on • Originally published at Medium on

Useful Golang packages and tools

Cover image from:

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 👌



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.
Enter fullscreen mode Exit fullscreen mode



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



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:



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 ""

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
Enter fullscreen mode Exit fullscreen mode


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

Top comments (9)

plutov profile image
Alex Pliutau

Nice article Ahmed. A bit related about tools -

martyonthefly profile image
Sylvain Marty

Very useful post ! Thank you for sharing <3

z0al profile image

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

ryuheechul profile image
Heechul Ryu

Very interesting and useful, thanks!

z0al profile image

You're welcome :)

defman profile image
Sergey Kislyakov

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

anikhasibul profile image
Hasibul Hasan (Anik)

Thanks for sharing!