You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current doc comment for File.Readdirhere states that when n > 0, the error value will be populated if no FileInfo is returned. The reproduction I linked below clearly shows this isn't always the case, at least with the dir_unix.go implementation of it here.
Should the documentation be changed, or should the implementation be fixed to error correctly if the implementation-specific method did not behave as the documentation suggests it should?
I'd be happy to submit a patch for this either way.
What version of Go are you using (go version)?
go version devel +e6f9f39 Mon Aug 29 18:25:33 2016 +0000 linux/amd64
What operating system and processor architecture are you using (go env)?
amd64, linux
What did you do?
# Download the repro from https://gist.github.com/euank/72cc2f1d13630eecd5459d8fe68e60b6
$ go run readdir_bug.go | grep "this is a bug"
Observed err=<nil> and files=[]; this is a bug
The text was updated successfully, but these errors were encountered:
The current doc comment for
File.Readdir
here states that whenn > 0
, the error value will be populated if no FileInfo is returned. The reproduction I linked below clearly shows this isn't always the case, at least with thedir_unix.go
implementation of it here.It is trivial to reproduce this using the following example program: https://gist.github.com/euank/72cc2f1d13630eecd5459d8fe68e60b6
Should the documentation be changed, or should the implementation be fixed to error correctly if the implementation-specific method did not behave as the documentation suggests it should?
I'd be happy to submit a patch for this either way.
What version of Go are you using (
go version
)?go version devel +e6f9f39 Mon Aug 29 18:25:33 2016 +0000 linux/amd64
What operating system and processor architecture are you using (
go env
)?amd64, linux
What did you do?
The text was updated successfully, but these errors were encountered: