Go Config

When I decided to write a configuration file package for Go, there were a few basic features that I knew it must have.  There were already plenty of other Go config packages on GitHub that were capable of reading several configuration formats, YAML, JSON, XML, etc  But I wanted to design something better.  I wanted to design a format; that would handle most or the Go data types, encompass many of the best features of other configuration formats and still be as simple as possible and above all, human readable.

What I ended up with was a configuration file format and a parsing package that had much more capability than what I had originally intended.  The following list identifies most of the important features of my configuration package:

  • Equal or colon assignment symbols
  • Nesting with curly braces
  • Numeric shorthand
  • Scientific notation
  • Commas to make large number more readable
  • Heredoc and long line continuation
  • Camel to snake case key conversion
  • Non case sensitive keys
  • Include files

Example configuration file
GitHub repository


Leave a Reply

Your email address will not be published. Required fields are marked *