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

HackTheBox | Node Writeup

Custom linking to Matic in Uniswap

Publishing to NPM using CircleCI

A closer look into AppSheet

Same Time, Same Desk: Rails Conference and React Summit

Metavibe — Your vibe in the Metaverse

Manifold Operators

Tutorial Fuzzy Logic Mamdani for Arduino

Tutorial Fuzzy Logic Mamdani for Arduino

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

Nil Pointer Method Receivers In Go

Detailed logging with Golang

Go Pipeline for a layman