-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dirs #46
Dirs #46
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments, thanks much!
README.md
Outdated
@@ -2,6 +2,8 @@ | |||
|
|||
[![Build Status](https://travis-ci.org/rakyll/statik.svg?branch=master)](https://travis-ci.org/rakyll/statik) | |||
|
|||
This is a fork of github.com/rakyll/statik - I wanted working Readdir. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this line please.
fs/walk.go
Outdated
@@ -0,0 +1,97 @@ | |||
// Copyright 2018 Tamás Gulácsi. All Rights Reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert the license header to the previous.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is totally new, but I don't object.
fs/walk.go
Outdated
"path" | ||
) | ||
|
||
var SkipDir = errors.New("skip dir") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be more
var DirectorySkippedError
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about using filepath.SkipDir?
I copied filepath.WalkFunc and filepath.SkipDir, you suggested just referencing it - keep it consistent, and use filepath.SkipDir.
fs/walk.go
Outdated
// Walk skips the directory's contents entirely. | ||
// If the function returns SkipDir when invoked on a non-directory file, | ||
// Walk skips the remaining files in the containing directory. | ||
type WalkFunc func(path string, info os.FileInfo, err error) error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about just using filepath.WalkFunc instead of introducing this type?
- remove "fork" comment from README - revert change of licensing in fs/walk.go - fix fs/ tests for directories.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Add directories and ReadFile.