Beispiel #1
0
// Reads directory contents from the given path and returns file names.
func (ts *Templates) readDir(path string) (names []string, err error) {
	var f fauxfile.File
	if f, err = ts.fs.Open(path); err != nil {
		return
	}
	defer f.Close()
	names, err = f.Readdirnames(-1)
	return
}
Beispiel #2
0
// Reads directory contents from the given path and returns file names.
func (gw *GhostWriter) readDir(path string) (names []string, err error) {
	var f fauxfile.File
	if f, err = gw.fs.Open(path); err != nil {
		return
	}
	defer f.Close()
	names, err = f.Readdirnames(-1)
	return
}