| Index: client/internal/common/filesystem_view.go
|
| diff --git a/client/internal/common/filesystem_view.go b/client/internal/common/filesystem_view.go
|
| index 42bd5022495d6430ea7f59dbedebafaac95ececb..5f60a831559a828c81d7d87c5a813181d3c92b72 100644
|
| --- a/client/internal/common/filesystem_view.go
|
| +++ b/client/internal/common/filesystem_view.go
|
| @@ -16,6 +16,7 @@ package common
|
|
|
| import (
|
| "fmt"
|
| + "os"
|
| "path/filepath"
|
| )
|
|
|
| @@ -79,3 +80,16 @@ func match(pattern, name string) bool {
|
| matched, _ := filepath.Match(pattern, name)
|
| return matched
|
| }
|
| +
|
| +// WalkFuncSkipFile is a helper for implemenations of filepath.WalkFunc. The
|
| +// value that it returns may in turn be returned by the WalkFunc implementaiton
|
| +// to indicate that file should be skipped.
|
| +func WalkFuncSkipFile(file os.FileInfo) error {
|
| + if file.IsDir() {
|
| + return filepath.SkipDir
|
| + }
|
| + // If we were to return SkipDir for a file, it would cause
|
| + // filepath.Walk to skip the file's containing directory, which we do
|
| + // not want (see https://golang.org/pkg/path/filepath/#WalkFunc).
|
| + return nil
|
| +}
|
|
|