Check out example codes for "read contents of a file and convert to list + go". It will help you in understanding the concepts better.

Code Example 1

content, err := ioutil.ReadFile(filename)
if err != nil {
    //Do something
}
lines := strings.Split(string(content), "\n")

Learn ReactJs, React Native from akashmittal.com