1
0
mirror of https://github.com/golang/go synced 2024-11-20 05:44:44 -07:00

os: avoid panic when testing errors on Plan 9

R=golang-dev, bradfitz, akumar
CC=golang-dev
https://golang.org/cl/6017043
This commit is contained in:
Anthony Martin 2012-04-16 17:36:02 -07:00
parent 4cf577edf9
commit 74607d18c5

View File

@ -5,6 +5,9 @@
package os
func isExist(err error) bool {
if err == nil {
return false
}
if pe, ok := err.(*PathError); ok {
err = pe.Err
}
@ -12,6 +15,9 @@ func isExist(err error) bool {
}
func isNotExist(err error) bool {
if err == nil {
return false
}
if pe, ok := err.(*PathError); ok {
err = pe.Err
}
@ -19,6 +25,9 @@ func isNotExist(err error) bool {
}
func isPermission(err error) bool {
if err == nil {
return false
}
if pe, ok := err.(*PathError); ok {
err = pe.Err
}