Tutorials
Golang : Concurrency and goroutine example
Golang has concurrency build into the core design and this is one of the main features that attracted many veteran….... read more
Golang : Check if os.Stdin input data is piped or from terminal
There are times we need to write a program that need to behave in one way according to input from….... read more
Golang : Read file and convert content to string
Problem :
You want to read a file content and convert the content into string.
Solution :
Read the file….... read more
Golang : Sort and reverse sort a slice of integers
Problem :
How to sort and reverse sort a slice of integers ?
Solution :
Use sort.Ints and sort.Sort functions.….... read more
Golang : Sort and reverse sort a slice of runes
Problem :
How to sort and reverse sort a slice of runes ?
Solution :
Sorting runes depends on the….... read more
Golang : Sort and reverse sort a slice of bytes
Problem :
How to sort and reverse sort a slice of bytes ?
Solution :
Import "github.com/cznic/sortutil"
Use the ByteSlice….... read more
Golang : convert rune to unicode hexadecimal value and back to rune character
There are times when we need to convert a rune to unicode hexadecimal style for storage purpose, encryption, manipulation and….... read more
Golang : Sort and reverse sort a slice of floats
Problem :
How to sort and reverse sort a slice of floats ?
Solution :
Declare the slice type as….... read more
Golang : How to reverse elements order in map ?
There is no built in function in Golang that allow you to reverse the elements order in a map, but….... read more
Golang : Sort and reverse sort a slice of strings
Sometimes we will want to sort or reverse sort a collection of strings alphabetically. It is pretty easy to sort….... read more
Golang : Check if element exist in map
Key based element search on a map is the most frequent method use to retrieve the associated value. However, there….... read more
Golang : How to delete element(data) from map ?
Problem :
You need to delete some elements from a map.
Such as:
cities := map[string]string{ "city1":"New York", "city2":"Adelaide"….... read more
Golang : Copy directory - including sub-directories and files
Another day, another tutorial....ok...we will learn how to copy all the content of the directory to another directory with Go.….... read more
Golang : untar or extract tar ball archive example
Many system administrators like to use the tar
program to archive the entire directory and gzip
to compress newly created….... read more
Golang : Archive directory with tar and gzip
In the previous tutorial, we learn how to extract files from tar ball and deal with gzipped tar….... read more
Golang : How to GOTO ?
In this tutorial, we will learn how to use goto
keyword in Golang. It has been a while since I….... read more
Golang : Generate thumbnails from images
After learning how to resize images and crop images with Golang. We will learn how to….... read more
Unix/Linux : How to open tar.gz file ?
It has been a while since I touched tar files( have been using Mac for long time) and couple of….... read more