tiktok-dl/utils/readFileAsString.go

16 lines
254 B
Go
Raw Normal View History

2020-01-19 02:11:53 +00:00
package utils
import (
"io/ioutil"
"log"
)
// ReadFileAsString - Returns contents of given file
func ReadFileAsString(fileName string) string {
content, err := ioutil.ReadFile(fileName)
if err != nil {
log.Fatal(err)
}
return string(content)
}