Convert HEIC to JPG in Go
The “High Efficiency Image File Format” or HEIF is an image format often used by Apple devices. Although called HEIF, the file types are often heic (presumably the ‘c’ stands for container?) They use a similar encoding method of video formats and are deemed better quality and lower file size than standard jpeg files. In our example, we’re trying to convert these heic files back into jpg files though - so we can use them elsewhere, display them or what ever we choose.
Sleeping in Golang
How to pause execution and sleep for a number of seconds in Go (golang). We can use the time package from the standard library to sleep for a duration of time. You can use any duration of time, providing you use the constants provided. In our example below we sleep for two seconds, and to illustrate the point, we print out the time before and after we do this. This will only sleep the current goroutine, other parts will continue.
Install Latest Version of Go (Linux/OSX)
This article describes how to install the latest version of Go (golang). It also helpfully updates itself by pulling the latest version numbers directly, so you don’t have to go and dig out the latest version each time they release a version (yay!) - just copy and paste away. For more info, try their installer docs.