mirror of
https://github.com/rclone/rclone.git
synced 2025-02-08 07:46:16 +08:00
![Nick Craig-Wood](/assets/img/avatar_default.png)
This is possible now that we no longer support go1.12 and brings rclone into line with standard practices in the Go world. This also removes errors.New and errors.Errorf from lib/errors and prefers the stdlib errors package over lib/errors.
25 lines
418 B
Go
25 lines
418 B
Go
//go:build !plan9
|
|
// +build !plan9
|
|
|
|
package fserrors
|
|
|
|
import (
|
|
"syscall"
|
|
|
|
liberrors "github.com/rclone/rclone/lib/errors"
|
|
)
|
|
|
|
// IsErrNoSpace checks a possibly wrapped error to
|
|
// see if it contains a ENOSPC error
|
|
func IsErrNoSpace(cause error) (isNoSpc bool) {
|
|
liberrors.Walk(cause, func(c error) bool {
|
|
if c == syscall.ENOSPC {
|
|
isNoSpc = true
|
|
return true
|
|
}
|
|
isNoSpc = false
|
|
return false
|
|
})
|
|
return
|
|
}
|