1 // Copyright 2016 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 // +build appengine !linux,!darwin,!freebsd,!openbsd,!netbsd
14 // readDir calls fn for each directory entry in dirName.
15 // It does not descend into directories or follow symlinks.
16 // If fn returns a non-nil error, readDir returns with that error
18 func readDir(dirName string, fn func(dirName, entName string, typ os.FileMode) error) error {
19 fis, err := ioutil.ReadDir(dirName)
24 for _, fi := range fis {
25 if fi.Mode().IsRegular() && skipFiles {
28 if err := fn(dirName, fi.Name(), fi.Mode()&os.ModeType); err != nil {
29 if err == ErrSkipFiles {