On 2011/04/10 07:42:51, fhs wrote:
> Hello mailto:golang-dev@googlegroups.com,
>
> I'd like you to review this change to
> https://go.googlecode.com/hg/
I'm probably not much of a judge, but in your change to os_test.go, you're
checking len(small) against len(all) where the read explicitly asked for
len(all)+100 characters. That seems self-defeating.
Lucio.
> I'm probably not much of a judge, but in your change to os_test.go, you're
> checking len(small) against len(all) where the read explicitly asked for
> len(all)+100 characters. That seems self-defeating.
>
> Lucio.
Thanks, I changed it to make sure len(small) >= len(all), so that that small[i]
doesn't crash with "index out of range" in the loop. I'm assuming the test
allows len(small) to be in the range [len(all)+1, 100+len(all)] because if few
files were added, the order of the first len(all) files would change. I'm not
sure if this is a correct assumption.
Glad to have been of help. I'll bow to more knowledgeable persons to deal
with your follow-up question, I'm not clued up on that.
Lucio.
On Tue, Apr 12, 2011 at 7:41 PM, <fshahriar@gmail.com> wrote:
> I'm probably not much of a judge, but in your change to os_test.go,
>>
> you're
>
>> checking len(small) against len(all) where the read explicitly asked
>>
> for
>
>> len(all)+100 characters. That seems self-defeating.
>>
>
> Lucio.
>>
>
> Thanks, I changed it to make sure len(small) >= len(all), so that that
> small[i] doesn't crash with "index out of range" in the loop. I'm
> assuming the test allows len(small) to be in the range [len(all)+1,
> 100+len(all)] because if few files were added, the order of the first
> len(all) files would change. I'm not sure if this is a correct
> assumption.
>
>
>
> http://codereview.appspot.com/4381048/
>
PTAL
http://codereview.appspot.com/4381048/diff/2002/src/pkg/os/dir_plan9.go
File src/pkg/os/dir_plan9.go (right):
http://codereview.appspot.com/4381048/diff/2002/src/pkg/os/dir_plan9.go#newco...
src/pkg/os/dir_plan9.go:27: file.dirinfo.buf = make([]byte, syscall.STATMAX)
On 2011/04/12 21:40:01, r wrote:
> if you're not going to release this - and i don't think you can - it makes
> little sense to allocate it as a slice. just embed it as an array in the
> dirInfo.
>
> however, i'm nervous about the size of this temporary data.
>
> ok for now but maybe worth thinking about in future
Done.
I've moved the declaration of dirInfo into file_plan9.go because it's also in
file_unix.go and file_windows.go.
Issue 4381048: code review 4381048: os: fix Readdir in Plan 9
(Closed)
Created 14 years ago by fhs
Modified 14 years ago
Reviewers:
Base URL:
Comments: 6