File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -545,21 +545,15 @@ func Rename(
545
545
546
546
const (
547
547
// _ERROR_NOT_SAME_DEVICE is the error code returned by MoveFileEx on
548
- // Windows when attempting to move a file across devices. This can actually
549
- // be avoided on Windows by specifying the MOVEFILE_COPY_ALLOWED flag, but
550
- // Go's standard library doesn't do this (most likely to keep consistency
551
- // with POSIX, which has no such facility). Since we don't know the exact
552
- // mechanism by which MOVEFILE_COPY_ALLOWED (i.e. whether or not it uses an
553
- // intermediate file), we avoid using it via a direct call to MoveFileEx.
548
+ // Windows when attempting to move a file across devices (without the
549
+ // MOVEFILE_COPY_ALLOWED flag being specified).
554
550
_ERROR_NOT_SAME_DEVICE = 0x11
555
551
)
556
552
557
553
// IsCrossDeviceError checks whether or not an error returned from rename
558
554
// represents a cross-device error.
559
555
func IsCrossDeviceError (err error ) bool {
560
- if linkErr , ok := err .(* os.LinkError ); ! ok {
561
- return false
562
- } else if errno , ok := linkErr .Err .(syscall.Errno ); ! ok {
556
+ if errno , ok := err .(syscall.Errno ); ! ok {
563
557
return false
564
558
} else {
565
559
return errno == _ERROR_NOT_SAME_DEVICE
You can’t perform that action at this time.
0 commit comments