[41] Results

Golang : Clearing slice

golang slice

Slice is something that I use frequently in Go and I always prefer slice to array at anytime. If you….... read more


Golang : Simple histogram example

golang histogram slice iteration

This is a simple histogram program written in Golang. Can be useful in situations where you want to roughly assess….... read more


Golang : Warp text string by number of characters or runes example

golang line-break character-wrap rune-slice slice-character

Problem:

You have a long text string and you want to wrap the text according to a given number of….... read more


Golang : Convert []string to []byte examples

golang string-slice byte-slice convert

Problem :

You need a fast way to convert a []string to []byte type. To use in situations such as….... read more


Golang : Sort and reverse sort a slice of integers

golang sort reverse-sort slice

Problem :

How to sort and reverse sort a slice of integers ?

Solution :

Use sort.Ints and sort.Sort functions.….... read more


Golang : Convert string slice to struct and access with reflect example

golang reflect slice-to-struct

Writing this down here for my own future references. Basically, what this code does is to convert a given string….... read more


Golang : How to count duplicate items in slice/array?

golang count-duplicate slice array

Problem :

You need to count the number of duplicate items in a slice or array.

Solution :

Pseudo-code :….... read more


Golang : Convert slice to array

golang slice array convert copy

For new comer to Golang, slice and array can be confusing sometimes. In a nutshell, a slice length(size) is flexible….... read more


Advertisement

Advertisement