read from file to string golang code example Example: golang read file to string contents, err := ioutil.ReadFile("file.txt")