Commit 74607d18 authored by Anthony Martin's avatar Anthony Martin

os: avoid panic when testing errors on Plan 9

R=golang-dev, bradfitz, akumar
CC=golang-dev
https://golang.org/cl/6017043
parent 4cf577ed
......@@ -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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment