Tutorials
Golang : Totalize or add-up an array or slice example
A simple example on how to totalize or add-up all the integer elements in a slice/array. Just use a for
….... read more
Golang : Compare files modify date example
Problem:
You're writing a game that will create multiple save files and you want to compare the save game files….... read more
Golang : Fix go.exe is not compatible with the version of Windows you're running
Problem: You just installed the default binary download of Golang for Windows and when you attempt to execute go.exe
binary….... read more
Golang : Get executable name behind process ID example
Problem:
You want to check if a process is actually running and at the same time you want to find….... read more
Golang : Check if integer is power of four example
Problem:
You need to test if a given integer is a power of 4. For example, if given number =….... read more
Golang : Handle or parse date string with Z suffix(RFC3339) example
You want to convert a RFC3339 date string with Z suffix such as 2016-09-01T15:23:01Z
to Golang's time.Time
date type.
Golang : Convert date string to variants of time.Time type examples
Here are few examples on how to convert a given date of string type to equivalent time.Time
type. Most newbies….... read more
Golang : Setup API server or gateway with Caddy and http.ListenAndServe() function example
Writing this down for my own future references and hopefully it can be useful to you too. This is a….... read more
Golang : Secure file deletion with wipe example
Problem:
You are not sure if the file deleted by os.Remove()
function is good enough to remove your data forever.….... read more
Golang : Multi threading or run two processes or more example
Problem:
You want to run two or more processes(multi-threading) in Golang. For example, you want to run a web server….... read more
Golang : Find files by name - cross platform example
Problem:
You want to find or locate files by name or by wildcard in your Golang program to do stuff….... read more
Golang : Get login name from environment and prompt for password
Problem:
You want to write a Golang script(short program for administrating server, etc) that grab the current user's login name,….... read more
Golang : Daemonizing a simple web server process example
Problem:
You use the previous tutorial on how to put your Golang program into background but somehow found….... read more
Golang : Convert(cast) uintptr to string example
Problem:
You need a fast way to convert a variable of type uintptr
to type string
without using unsafe
package.….... read more
Golang : Resumable upload to Google Drive(RESTful) example
This tutorial is a supplement to previous tutorial on how to upload file to Google Drive via REST….... read more
Golang : Calculate entire request body length during run time
Problem:
You are trying to figure out what to fill into the number_of_bytes_in_entire_request_body
field when making a http.NewRequest()
. You need….... read more
Golang : Google Drive API upload and rename example
For this tutorial, we will explore how to upload file to Google Drive using RESTful method and rename the file….... read more
Golang : Remove characters from string example
Problem:
You have a string and you want to remove certain characters from the string base on a set of….... read more