Closed dmitshur closed 5 years ago
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.
File.Readdir
os.FileInfo
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.
string(out.Bytes())
out.String()
Fixes #68. Fixes shurcooL/httpfs#8. Closes shurcooL/httpfs#9.
Thanks!
Thanks for reviewing!
Implementations of the
File.Readdir
method are expected to treat all n <= 0 values the same, returning all theos.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 justout.String()
in a test.Fixes #68. Fixes shurcooL/httpfs#8. Closes shurcooL/httpfs#9.