Check out example codes for "golang read text file". It will help you in understanding the concepts better.

Code Example 1

It depends on what you are trying to do.

file, err := os.Open("file.txt")
The reason it outputs &{0xc082016240}, is because you are printing the pointer value of a file-descriptor (*os.File), not file-content. To obtain file-content, you may READ from a file-descriptor.

To read all file content(in bytes) to memory, ioutil.ReadAll

package main

import (

func main() {
    file, err := os.Open("file.txt")
    if err != nil {
    defer func() {
        if err = f.Close(); err != nil {

  b, err := ioutil.ReadAll(file)

Learn ReactJs, React Native from