golang read file into string code example
Example 1: read contents of a file and convert to list + go
content, err := ioutil.ReadFile(filename)
if err != nil {
//Do something
}
lines := strings.Split(string(content), "\n")
Example 2: golang read file to string
contents, err := ioutil.ReadFile("file.txt")