mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
os: delete os.EINVAL and so on
The set of errors forwarded by the os package varied with system and was therefore non-portable. Three helpers added for portable error checking: IsExist, IsNotExist, and IsPermission. One or two more may need to come, but let's keep the set very small to discourage thinking about errors that way. R=mikioh.mikioh, gustavo, r, rsc CC=golang-dev https://golang.org/cl/5672047
This commit is contained in:
parent
c560a0742b
commit
56069f0333
42 changed files with 278 additions and 218 deletions
|
|
@ -90,7 +90,7 @@ func (f *File) Close() error {
|
|||
|
||||
func (file *file) close() error {
|
||||
if file == nil || file.fd < 0 {
|
||||
return EINVAL
|
||||
return syscall.EINVAL
|
||||
}
|
||||
var err error
|
||||
if e := syscall.Close(file.fd); e != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue