Tutorials
Chrome : How to block socketloop.com links in Google SERP?
Problem:
You suspect that the atoms inside your brain will start to rearrange in undesirable ways or cause one or….... read more
Golang : Calculations using complex numbers example
Alright, you need to calculate the last known position of UFOs and their flying trajectory in Golang or you just….... read more
Golang : Function as an argument type example
When we need to invoke another function inside a.... let's say outer function, the typical way to do this is….... read more
Golang : Convert integer to binary, octal, hexadecimal and back to integer
Converting integers to binary, octal and hexadecimal is fairly common in programming life. Ported these simple functions from Python to….... read more
Golang : Accurate and reliable decimal calculations
If you have been programming for a long time, chances are you will be aware of a well-known issue with….... read more
Golang : Proper way to set function argument default value
In PHP, it is easy to specify the default values of a function arguments. All you need to do is….... read more
Golang : Warp text string by number of characters or runes example
Problem:
You have a long text string and you want to wrap the text according to a given number of….... read more
Golang : Characters limiter example
Problem:
You want to limit a string to X number of characters. How to do that?
Solution:
Use io.ReadAtLeast()
function….... read more
Golang : Simple word wrap or line breaking example
Problem:
You have a long text string and you want to wrap the text according to a given number of….... read more
Golang : Word limiter example
Problem:
You want to limit a string to X number of words. How to do that?
Solution:
Break the string….... read more
Golang : Interpolating or substituting variables in string examples
For this quick tutorial, we will explore how to interpolate(substitute) actual data into variables inside a string. Will keep these….... read more
Golang : Aligning strings to right, left and center with fill example
Problem:
You are so used to Python way of aligning text strings such as ljust()
, rjust()
and center()
and Golang's….... read more
Golang : Format strings to SEO friendly URL example
Problem:
You want to take a string and format it to SEO friendly URL. SEO friendly means no uppercase, underscore….... read more
Golang : Normalize unicode strings for comparison purpose
Here is a tutorial on of how to normalize unicode strings and do proper comparison of unicode strings. Suggest that….... read more
Golang : Copy map(hash table) example
Problem:
You have a map and you want to copy the elements to another map. How to do that ?
….... read moreGolang : Use wildcard patterns with filepath.Glob() example
Searching for files by extension can be done easily in Golang with filepath.Ext()
function. To search for files….... read more
Golang : Match strings by wildcard patterns with filepath.Match() function
Problem:
You want to match strings using the same wildcard patterns commonly used in Linux/Unix shells such as *.go
or….... read more
Golang : Extract or copy items from map based on value
Problem:
You want to copy map or make a new map with subset or extract items from another map based….... read more