Reading Configuration Files in Go

  • Manage Dependencies in Go.
  • Creation of Module in Go.
  • Reading Configuration Files in Go.
  • Go Get tool installs one dependency at a time. And it installs the latest version of the package.
  • Using a specific version of the package will also protect you from breaking changes the package might have. In Go 111, we got a new mod tool to handle dependency management.
  • At line #20, we now open the file, and as usual, validate the error, which should be not nil.
  • At line #27, we use a new decoder for toml and then using the same decoder, we would read the configuration file and populate the configuration object directly.




Software Engineer for Big Data distributed systems

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Setting Up Devise For Your Ruby on Rails Application

Nervos attends Grin meetup and shares Mimblewimble update

Attendees listen to a speaker at the Grin Community meetup

Manual & Autonomous Farming

Daily Progress: Giving our Zombies a Fighting Chance!

Weekly update from PointPay (November 22— November 26, 2021)

Adventures in GameDev with GameDevHQ — Implementing a cooldown system.

Bug Bounty Hunting — How I Earned $500 In 4 Hours

Phishing Logo

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
aditya goel

aditya goel

Software Engineer for Big Data distributed systems

More from Medium

Building basic micro-service with GoRilla

[Crazy Go Day] Why Using Gin For Golang Backend?

TicTacGo — An Intro to Golang

Learn how to containerize your Go app in 5 minutes!