Waiting for Goroutines to completeGoroutines are one of the best features of Go language. It is very easy to run a function as a goroutine, you just have to use the keyword go before the function call. Here is a very simple function which sleeps for n seconds and prints a line. pa...Dec 15, 2018·3 min read
Regular Expressions in GoRegular Expressions is one skill that is essential to any programmer. We deal with lot of unstructured data and regexps are one vital tool to parse and process it. Lets look at the different functions and methods available to construct and use regu...Dec 10, 2018·4 min read
Basic Logging in GoAny application you write, should have proper logging to ensure you are able to monitor and identify problems in production. You can't and shouldn't run a debugger in a production environment and logs are the only proper way to get an idea of what is...Dec 9, 2018·2 min read
Accepting Variable Number of Arguments in a FunctionFunctions in Go are capable of accepting multiple number of arguments, also called as variadic functions. One prominent example of such a function is fmt.Println as you can pass in any number of variables, it will print each of them separated by a sp...Dec 8, 2018·1 min read
Loading Application Config from Environment VariablesIn a previous post, I had written how to read Environment Config. I had also mentioned how you can only store and retrieve string values. But if your application is trying to load config files from it, you would want to load the variables as integer ...Dec 7, 2018·2 min read
Listing Files and Directories in GoNext to reading/writing to files, learning how to list the different files and directories is very important. I used to use python for doing lot of string processing and the common way to store data is in the form of jsonl files in a directory. And y...Dec 6, 2018·3 min read
Access Environment Variables in GoEnvironment variables are an easy way to pass configuration settings to your program. This allows you to not store sensitive config settings like database passwords or API keys in your code or local files. This is the way Heroku passes any configurat...Dec 5, 2018·2 min read