[30] Results

Golang : How to check variable or object type during runtime?

golang object-variable-type kind type-of reflect

Problem :

You need to determine the type of data your program is getting from the user input or the….... read more

Golang : cannot assign type int to value (type uint8) in range error

golang cannot-assign-type error

Sometimes, we tend to overlook a small part of for--loop just because we use it frequently and expect the compiler….... read more

Golang : Fix type interface{} has no field or no methods and type assertions example

golang type-assertions interface map-string-interface

For new comers to Golang exploring interface{} for the first time or if you ever use interface{} to handle some….... 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 : How to convert(cast) IP address to string?

golang lookupip ip-address convert cast

Problem :

You need to convert(cast) the integer values you get from function such as net.LookupIP() or type IP (.... read more

Golang : Dealing with struct's private part

golang public private type struct methods

One of the most common things in Golang that easily confuse a newbie is how to declare variable/constant/identifier name properly.….... read more

Golang : Detect variable or constant type

golang reflect type-of variable constant

Problem :

You have a variable or constant and you want to know which type the variable belongs to.

Solution….... read more

Golang : Convert(cast) uintptr to string example

golang uintptr string convert-cast unsafe


You need a fast way to convert a variable of type uintptr to type string without using unsafe package.….... read more