示例#1
0
文件: template.go 项目: kurrik/tmpl
// 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
}
示例#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
}