Answers for "golang read contents of file"

Go
0

golang read file to string

contents, err := ioutil.ReadFile("file.txt")
Posted by: Guest on March-25-2021
1

golang read file

file_data, err := ioutil.ReadFile("./index.html")
if err != nil {
	fmt.Println(err)
}
fmt.Println(file_data)
Posted by: Guest on February-04-2022

Browse Popular Code Answers by Language