// go read file to string b, err := ioutil.ReadFile("file.txt") // just pass the file name if err != nil { fmt.Print(err) } str := string(b) // convert content to a 'string'