示例#1
0
文件: util.go 项目: NetSys/quilt
// ReadFile returns the contents of `filename`.
func ReadFile(filename string) (string, error) {
	a := afero.Afero{
		Fs: AppFs,
	}
	fileBytes, err := a.ReadFile(filename)
	if err != nil {
		return "", err
	}
	return string(fileBytes), nil
}
示例#2
0
文件: io.go 项目: NetSys/quilt
func fileContents(file string) (string, error) {
	a := afero.Afero{
		Fs: appFs,
	}
	contents, err := a.ReadFile(file)
	if err != nil {
		return "", err
	}
	return string(contents), nil
}