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
Readdir should treat zero for count value as it was negative to be fully compatible with the interface #68
Comments
Maybe related to this issue: #58 |
Happy to review the change if you would like to send one! Otherwise, I can only look at it later this week. |
@shakahl Are you still planning to send a PR? If not, I can do it. |
Go for it :).
man. 8. jul. 2019, 02:45 skrev Dmitri Shuralyov <notifications@github.com>:
… @shakahl <https://github.com/shakahl> Are you still planning to send a
PR? If not, I can do it.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#68?email_source=notifications&email_token=AAXOYAUHCLOWVMSIHAXTUG3P6J53FA5CNFSM4HP6ASZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZLVLBA#issuecomment-509040004>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAXOYAQCH5FOFU665CSYQ3TP6J53FANCNFSM4HP6ASZQ>
.
|
@dmitshur Thank you for the PR! :) Unfortunately, I've been a little bit overwhelmed in the last few weeks. |
No problem @shakahl, that's very relatable. Thanks for reporting this issue. |
rakyll
pushed a commit
that referenced
this issue
Jul 9, 2019
Implementations of the File.Readdir method are expected to treat all n <= 0 values the same, returning all the os.FileInfo structures from the directory in a single slice. This is documented at https://godoc.org/net/http#File.Readdir and https://godoc.org/os#File.Readdir. Previously, the n == 0 value was not being handled correctly. This change fixes it by making it work the same as all other negative values of n. Add a test case for it. Also simplify string(out.Bytes()) to just out.String() in a test. Fixes #68. Fixes shurcooL/httpfs#8. Closes shurcooL/httpfs#9.
ekanna
pushed a commit
to ekanna/statik
that referenced
this issue
Sep 12, 2019
Implementations of the File.Readdir method are expected to treat all n <= 0 values the same, returning all the os.FileInfo structures from the directory in a single slice. This is documented at https://godoc.org/net/http#File.Readdir and https://godoc.org/os#File.Readdir. Previously, the n == 0 value was not being handled correctly. This change fixes it by making it work the same as all other negative values of n. Add a test case for it. Also simplify string(out.Bytes()) to just out.String() in a test. Fixes rakyll#68. Fixes shurcooL/httpfs#8. Closes shurcooL/httpfs#9.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @rakyll
Thanks for the
statik
, it's a great lib:)I found an issue in the
Readdir
implementation while I was using another library that called statik's fs.Readdir(0) and it resulted in a problem. No file was found in this case.It should treat the zero value and the negatives the same as the GoDoc recommends: https://golang.org/pkg/os/#File.Readdir
The problematic
Readdir
implementation:statik/fs/fs.go
Line 190 in 3bac566
I fould the issue when I was using this library: shurcooL/httpfs#8
All best,
@shakahl
The text was updated successfully, but these errors were encountered: