[15] Results

Golang : Byte format example

golang round byte-format giga mega terra


You want to format the long integer or number string representing a byte size such as giga, mega, peta….... read more

Golang : Convert an image file to []byte

golang image convert byte

This is a quick tutorial on how to convert an image file to byte array. This question was originally posted….... read more

Golang : constant 20013 overflows byte error message

golang write-byte

Haven't been updating the tutorials portion for a while as I was busy writing up examples for Golang bytes package. While executing the bytes.Buffer.WriteByte function….... read more

Golang : Convert []byte to image

golang image convert byte

There are times when you need to convert []byte to image for saving into file purpose. I encountered one of….... read more

Golang : Convert(cast) []byte to io.Reader type

golang convert cast byte io-reader

Problem :

Need to convert XML data from http.Get() to io.Reader type for xml.NewDecoder() function to work . How to….... read more

Golang : Clean formatting/indenting or pretty print JSON result

golang json indent clean-format


Your Golang program is producing JSON result in a single line that looks like this :

.... read more

Golang : How to control fmt or log print format?

golang fmt log printf-format

How to control fmt or log print format output? Use this reference as guide on how to control the fmt….... read more

Golang : Convert date string to variants of time.Time type examples

golang date convert-timestamp format-date

Here are few examples on how to convert a given date of string type to equivalent time.Time type. Most newbies….... read more