golang.pngGolang : Reverse IP address for reverse DNS lookup example

Problem:

You need to reverse a given IPv4 address into a DNS reverse record form to perform reverse….... read more



golang.pngGolang : Skip blank/empty lines in CSV file and trim whitespaces example

Problem:

Your Golang program is reading from a CSV file and you want to skip blank lines in the CSV….... read more



golang.pngGolang : Save map/struct to JSON or XML file

Previous tutorial on converting map/slice/array to JSON or XML format is for output to web via net/http package.….... read more



golang.pngGolang : Clean formatting/indenting or pretty print JSON result

Problem:

Your Golang program is producing JSON result in a single line that looks like this :

["apple","orange","durian","pear"]
.... read more



golang.pngGolang : How to convert strange string to JSON with json.MarshalIndent

Problem:

Your database is spewing out a funny looking string that looks like this {"width";800;"height";450} and you want to map….... read more



golang.pngGolang : How to convert JSON string to map and slice

Couple of simple examples on how to convert JSON string to map and slice(array).

Simple and straightforward way of converting….... read more



golang.pngGolang : Totalize or add-up an array or slice example

A simple example on how to totalize or add-up all the integer elements in a slice/array. Just use a for.... read more



golang.pngGolang : Compare files modify date example

Problem:

You're writing a game that will create multiple save files and you want to compare the save game files….... read more



golang.pngGolang : Fix go.exe is not compatible with the version of Windows you're running

Problem: You just installed the default binary download of Golang for Windows and when you attempt to execute go.exe binary….... read more



golang.pngGolang : Get executable name behind process ID example

Problem:

You want to check if a process is actually running and at the same time you want to find….... read more



golang.pngGolang : Check if integer is power of four example

Problem:

You need to test if a given integer is a power of 4. For example, if given number =….... read more



golang.pngGolang : Handle or parse date string with Z suffix(RFC3339) example

You want to convert a RFC3339 date string with Z suffix such as 2016-09-01T15:23:01Z to Golang's time.Time date type.

.... read more



Advertisement

Advertisement

Advertisement