Commit fd84aa98 authored by Jeromy's avatar Jeromy

rename hidden field

License: MIT
Signed-off-by: default avatarJeromy <jeromyj@gmail.com>
parent 0b97387e
......@@ -19,7 +19,7 @@ type serialFile struct {
files []os.FileInfo
stat os.FileInfo
current *File
hidden bool
handleHiddenFiles bool
}
func NewSerialFile(name, path string, hidden bool, stat os.FileInfo) (File, error) {
......@@ -70,7 +70,7 @@ func (f *serialFile) NextFile() (File, error) {
stat := f.files[0]
f.files = f.files[1:]
for !f.hidden && strings.HasPrefix(stat.Name(), ".") {
for !f.handleHiddenFiles && strings.HasPrefix(stat.Name(), ".") {
if len(f.files) == 0 {
return nil, io.EOF
}
......@@ -86,7 +86,7 @@ func (f *serialFile) NextFile() (File, error) {
// recursively call the constructor on the next file
// if it's a regular file, we will open it as a ReaderFile
// if it's a directory, files in it will be opened serially
sf, err := NewSerialFile(fileName, filePath, f.hidden, stat)
sf, err := NewSerialFile(fileName, filePath, f.handleHiddenFiles, stat)
if err != nil {
return nil, err
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment