我在阅读 http://golang.org/doc/effective_go.html#errors 时,发现了这样一行代码:err.(*os.PathError)
。
for try := 0; try < 2; try++ {
file, err = os.Create(filename)
if err == nil {
return
}
if e, ok := err.(*os.PathError); ok && e.Err == syscall.ENOSPC {
deleteTempFiles() // Recover some space.
continue
}
return }
err.(*os.PathError)
在Go语言中究竟是什么?