[76] Results

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 : Word limiter example

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


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


Break the string….... read more

Golang : Populate or initialize struct with values example

golang struct init populate-struct

A quick and short example on how to populate or initialize a struct with values. Pretty straight forward, but it….... 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 : How to unmarshal JSON inner/nested value and assign to specific struct?

golang inner-JSON unmarshal struct

Another tutorial to be recorded here after helping a newbie to Golang. His problem was how to deal with JSON….... read more

Golang : Implement getters and setters

golang get set identifier struct

Because Golang does not provide automatic getters and setters, Go programmers will have to implement the getters and setters themselves.….... read more

Golang : What is StructTag and how to get StructTag's value?

golang struct-tag

For those who code or read Golang's code and left wondering what are those string inside the '``' such as….... read more