Golang Tutorials

  • Optimize API performance with Gzip Compression in Golang

    An application’s performance is a crucial aspect that directly impacts user’s satisfaction and search engine rankings. In one of the projects I worked in, we got users complaining about our application’s performance. On digging further, we found that the response body of an API we used was huge and the application spent long time on…


  • Golang Viper – load multiple configuration files

    In a previous post, I covered on basic usage of the Golang library Viper. As of version v1.14.0, a single Viper instance supports loading configurations from only one configuration file. If our application work with multiple configuration files, then we have to manage this manually. This post covers how to load configurations from multiple configuration files…


  • Using Viper with environment variables in Golang

    In a previous post, I have explained how to use Viper. As a continuation, this post will cover on using Viper with environment variables in a Golang application. Just like loading configuration from a configuration file, using Viper, we can also load configuration from environment variables. Viper provides three methods to work with environment variables.…