]> Cypherpunks repositories - gostls13.git/commit
os: be consistent about File methods with nil receivers
authorRob Pike <r@golang.org>
Tue, 20 Aug 2013 04:33:03 +0000 (14:33 +1000)
committerRob Pike <r@golang.org>
Tue, 20 Aug 2013 04:33:03 +0000 (14:33 +1000)
commit4cb086b838548fa5dbdcb502a51b29294e268db6
tree51b01536fb3a47f0e8af6c137d7ab69f385cf59c
parenta3695fb2273d458974a02bc19f1606f10e6ff388
os: be consistent about File methods with nil receivers
Some crashed, some didn't. Make a nil receiver always
return ErrInvalid rather than crash.
Fixes #5824.
The program in the bug listing is silent now, at least on my Mac.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/13108044
src/pkg/os/doc.go
src/pkg/os/file.go
src/pkg/os/file_plan9.go
src/pkg/os/file_posix.go
src/pkg/os/file_unix.go
src/pkg/os/file_windows.go
src/pkg/os/stat_windows.go