Tutorials
Golang : Web(Javascript) to server-side websocket example
For this tutorial, we will explore how to write a HTML page with Javascript/JQuery that interface with server-side Golang service….... read more
Golang : Gorilla web tool kit schema example
This is an example on how to use Gorilla web tool kit Schema package. The Schema package is….... read more
Golang : Gorilla web tool kit secure cookie example
Sometimes we need to track user payment status and store the items to be purchased in the browser's cookies cache/jar.….... read more
Golang : Unmarshal JSON from http response
For this tutorial, we will learn how to unmarshal JSON data retrieved from http.Get()
function. Using the HTTP….... read more
Golang : Encode image to base64 example
We will learn how to convert an image to base64 encoded string in this tutorial. Converting image data to base64….... read more
Golang : How to use Gorilla webtoolkit context package properly
Many new comers to Gorilla web toolkit are confused as why they cannot pass variables to another handler with the….... read more
Golang : How to feed or take banana with Gorilla Web Toolkit Session package
From previous tutorial on context package, we learn that in order to pass data to other handlers outside….... read more
Golang : Build new URL for named or registered route with Gorilla webtoolkit example
Problem :
Ok, you want to construct a new URL with Gorilla webtoolkit but don't know how. For example, you….... read more
Golang : Example of custom handler for Gorilla's Path usage.
In Gorilla WebToolkit's official documentation, the code fragment given in http://www.gorillatoolkit.org/pkg/mux#Route.Path does not show how to create custom….... read more
Golang : Gorrila mux.Vars() function example
Gorrila Web toolkit mux.Vars() function usage example. Vars contains the URI variables of the current request.
For example :
URL….... read more
Golang : Gorrila set route name and get the current route name
Problem :
You want to know the current route that your user is using on your website and retrieve the….... read more
Golang : Determine if directory is empty with os.File.Readdir() function
Problem :
You are traversing a directory tree with filepath.Walk()
function and you need to find out if a directory….... read more
Golang : Read data from config file and assign to variables
Usually a large program will need multiple parameters to function properly and the parameters will determine the behavior of the….... read more
Golang : Auto-generate reply email with text/template package
Problem :
You have customers that ask question via email that sometimes bordering repetitive questioning or simply refused to read….... read more
Golang : How to count the number of repeated characters in a string?
Problem :
You want to develop a new algorithm that somehow will reduce or compress the size of a string….... read more
Golang : How to check if a string starts or ends with certain characters or words?
Problem :
You are building a rule for parsing text strings and you want to determine if a string starts….... read more
Golang : How to get ECDSA curve and parameters data?
Problem :
"ECDSA cents have a parameters block which has the parameters for the….... read more
Golang : How to get garbage collection data?
Problem :
You have read the previous tutorial on recovering memory and you want to trigger garbage collection….... read more