Golang: Check If slice Is Empty
When you want to check if a slice is empty simply check the length of the slice with len() method: You can use len() on… Read More »Golang: Check If slice Is Empty
When you want to check if a slice is empty simply check the length of the slice with len() method: You can use len() on… Read More »Golang: Check If slice Is Empty
Another day, another type conversion in Golang 🙂 Today we want to convert a number from string into int64 type, using ParseInt method from strconv… Read More »Convert string to int64 in Golang
Yes, Golang cares about how you declare and use the variable 🙂 If you declared a variable but have not used it in the code… Read More »Golang: Two Fix for Declared and Not Used
In any Golang boolean checking statement, you can use || operator instead of OR:
Remembering the conversion solutions in golang is not easy, but the fmt package is always with us. By using the Sprintf method it is super… Read More »How to Convert Float to N Decimal Place String in Go
Simplest way to convert a string to a slice of bytes: A set of examples to convert string to []byte:
Yes, you want to format a string without printing it! fmt package is your friend when you working with string type, use Sprintf method and… Read More »How to String Formatting in Golang?
Yes, you can get the type of any variable with TypeOf function from the reflect package: Simplest example is here:
Append is a basic function you need to learn when you are working with slices in golang: This example shows you three ways of appending… Read More »Golang Slice Append: One or Multiple Items
When debugging a code it is helpful to have a way to simply print the values into the console. If you want the indention and… Read More »Print Struct as String in Golang