build: fix linting issues reported by golangci-lint on windows

This commit is contained in:
albertony 2024-04-17 16:40:07 +02:00
parent fdc56b21c1
commit 159e274921
9 changed files with 21 additions and 60 deletions

View file

@ -4,14 +4,10 @@ package local
import (
"os"
"syscall"
"time"
"github.com/rclone/rclone/fs"
)
const (
ERROR_SHARING_VIOLATION syscall.Errno = 32
"golang.org/x/sys/windows"
)
// Removes name, retrying on a sharing violation
@ -27,7 +23,7 @@ func remove(name string) (err error) {
if !ok {
break
}
if pathErr.Err != ERROR_SHARING_VIOLATION {
if pathErr.Err != windows.ERROR_SHARING_VIOLATION {
break
}
fs.Logf(name, "Remove detected sharing violation - retry %d/%d sleeping %v", i+1, maxTries, sleepTime)