Exemplo n.º 1
0
Arquivo: util.go Projeto: 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
}
Exemplo n.º 2
0
Arquivo: io.go Projeto: 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
}