【发布时间】:2013-08-24 05:52:47
【问题描述】:
阅读时: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 }
Go 中的 err.(*os.PathError) 到底是什么?
【问题讨论】:
标签: go