Tutorials
Golang : When to use public and private identifier(variable) and how to make the identifier public or private?
Got a Golang related question by my friend today, who is learning Golang for the first time. Her question is….... read more
Golang : Dealing with struct's private part
One of the most common things in Golang that easily confuse a newbie is how to declare variable/constant/identifier name properly.….... read more
How to show different content from website server when AdBlock is detected?
Problem :
The ads you placed on your website are not showing up because they were blocked by browsers based….... read more
Google : Block or disable caching of your website content
Problem :
You don't want Google or other search engines to cache your page content for reason such as -….... read more
Golang : fmt.Println prints out empty data from struct
Problem :
Your code compiled successfully and there is no error indicator whatsoever. However, during runtime, the fmt.Println function prints….... read more
Golang : Check version
Sometimes, the most obvious thing can be the hardest to remember. This is just a quick note for future usage...in….... read more
Golang : How to count duplicate items in slice/array?
Problem :
You need to count the number of duplicate items in a slice or array.
Solution :
Pseudo-code :….... read more
Golang : Execute shell command
A programming language will not be complete if there is no way for the developer to execute shell command. In….... read more
Golang : Get absolute path to binary for os.Exec function with exec.LookPath
Sometimes it is good to tell our Golang program to execute exactly which binary file based on the path. For….... read more
Golang : alternative to os.Exit() function
Just a quick note on the alternative to os.Exit()
function, which is the syscall.Exit()
function. Both functions behave the same….... read more
Golang : Detect user location with HTML5 geo-location
Problem :
You need to detect your visitor's location (i.e latitude and longitude) and display on Google map showing the….... read more
Golang : Debug with Godebug
A quick note on debugging in Golang and the latest tool that a sane Golang developer should check out and….... read more
Javascript : Get operating system and browser information
Problem :
You need to find out your visitor's browser and os version. How to do that with Javascript or….... read more
Golang : Convert source code to assembly language
If you ever have the urge to convert your Golang source code to assembly language, check out this online tool….... read more
Golang : Convert slice to array
For new comer to Golang, slice and array can be confusing sometimes. In a nutshell, a slice length(size) is flexible….... read more
Golang : Comparing date or timestamp
Problem :
You have to compare two timestamps to see if the they are equal or not.
Solution :
Use….... read more
Golang : Create zip/ePub file without compression(use Store algorithm)
Problem :
You need to create zip file without compression. i.e just use the Store algorithm. For example, you are….... read more
Golang : Convert Unix timestamp to UTC timestamp
Problem :
You have a Unix timestamp and you want to convert it to UTC time format. How to do….... read more