tiktok-dl/utils/readFileAsString.go

15 lines
290 B
Go
Raw Normal View History

2020-01-19 02:11:53 +00:00
package utils
import (
"io/ioutil"
2020-03-22 00:10:24 +00:00
2020-04-12 01:22:00 +01:00
checkErr "github.com/pikami/tiktok-dl/utils/checkErr"
2020-01-19 02:11:53 +00:00
)
// ReadFileAsString - Returns contents of given file
func ReadFileAsString(fileName string) string {
content, err := ioutil.ReadFile(fileName)
2020-03-22 00:10:24 +00:00
checkErr.CheckErr(err)
2020-01-19 02:11:53 +00:00
return string(content)
}