Tutorials
Golang : Populate dropdown with html/template example
Creating a clickable dropdown button or HTML select tag is a common task for populating a form. Here is a….... read more
Golang : Check if user agent is a robot or crawler example
Problem:
You need to determine if the user agent that visiting your web server is a bot/robot/crawler. You have tried….... read more
Golang : How to determine if user agent is a mobile device example
With the increasing number of people accessing the Internet with mobile devices such as tablet or smart phone apart from….... read more
Golang : Increment string example
Problem:
You need to create "copies" of a file, prevent user from overwriting files accidentally or need duplicate database content….... read more
Golang : Get current URL example
One of the common tasks that a web application developer will encounter is on how to get the currently viewed….... read more
Golang : On lambda, anonymous, inline functions and function literals
This is just a note for myself and maybe it can be useful to you too. In Golang, lambda, anonymous….... read more
Golang : Accept any number of function arguments with three dots(...)
There are times when we need to create functions that are able to accept any number of arguments(a.k.a trailing arguments)….... read more
Golang : The Tao of importing package
Jotting down this quick tutorial on how to use import
statement properly with formatted I/O - fmt package. However, this….... read more
Golang : Combine slices but preserve order example
In the previous tutorial on how to join arrays in Golang, we use the append
function to join….... read more
Golang : Join arrays or slices example
A quick note on how to join arrays or slices in Golang. So used to Python way of joining arrays….... read more
Golang : Skip or discard items of non-interest when iterating example
Problem:
You want to skip or discard items of non-interest when iterating. For example, skipping the commented lines with #
….... read more
Golang : Loop each day of the current month example
Problem:
You need to get the current month, find out the number of days in the month programmatically and loop….... read more
Golang : Emulate NumPy way of creating matrix example
Problem:
You are so used to NumPy way of creating matrix and you have difficult time in adapting….... read more
Golang : Linear algebra and matrix calculation example
Continuing from our previous tutorial on how to create matrix with Gonum, we will explore how to perform….... read more
Golang : Create matrix with Gonum Matrix package example
Here is an example of how to create and display matrix properly in Golang with Gonum package. Nothing special in….... read more
Golang : Arithmetic operation with numerical slices or arrays example
Got an email from a new comer to Golang from South Africa, he or she wanted to know how to….... read more
Golang : Test floating point numbers not-a-number and infinite example
A simple example to demonstrate how to create not-a-number
and infinite
floating-point values in Golang. Will show some example tests….... read more
Golang : Combine slices of complex numbers and operation example
Extension from a previous tutorial on how to perform calculations with complex numbers. For this tutorial, we will….... read more