Channel your inner snek ๐Ÿ to configure your Go programs

Donald Feury
1 min readAug 10, 2020

--

You can get quite far configuring your go programs with the standard library. You can read in your config file, or pass in arguments and parse them with the flag package. However, what you wanted to do all these things interchangeably and with much more ease?

Enter viper, go configuration with fangs as they say! With viper, you can do ALL of the following:

  • setting default values for your configuration
  • read from popular config file formats, such as JSON, TOML, and YAML
  • watch your config file and live reload any changes
  • reading from environment variables
  • reading from remote config systems, such as etcd
  • reading from command line flags
  • reading from buffer
  • setting explicit values

Check out the video to see an example of some of things you can do with viper.

The tables have turned

Shout out to my wife who makes these hilarious thumbnails, follow her on twitter and instagram for more art stuff.

If you liked it and want to know when I post more, be sure to subscribe and thank yaโ€™ll again for your time!

This was originally posted on my blog

--

--

Donald Feury
Donald Feury

Written by Donald Feury

Appalachian Boi, Technology Consultant, Content Creator

No responses yet