[142] Results

Golang : Word limiter example

golang slice-to-string word-limiter count-words

Problem:

You want to limit a string to X number of words. How to do that?

Solution:

Break the string….... read more


Golang : Turn string or text file into slice example

golang text-string convert-to-slice delete copy append

Alright, I need to parse a large number of text files that contain some raw data generated by a machine.….... 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 convert JSON string to map and slice

golang json-to-map json-to-slice array

Couple of simple examples on how to convert JSON string to map and slice(array).

Simple and straightforward way of converting….... read more


Golang : convert int to string

golang strconv convert-to-string

While working on previous tutorial on displaying struct values in string format with a method. I stumbled upon….... 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 : Convert string to array/slice

golang convert string array slice

Just a note for my own self. Hope it will be useful for you.

Problem :

You have a string….... read more


Golang : Convert int to byte array([]byte)

golang integer-to-byte-array strconv convert-to-string

Problem :

You need to convert integer variable or constant to byte array ( [] byte ). How to do….... read more


Advertisement