Fixes from go vet and errcheck

This commit is contained in:
Nick Craig-Wood 2015-09-22 07:31:12 +01:00
parent 05050d53ad
commit 2ed158aba3
7 changed files with 39 additions and 20 deletions

View file

@ -326,11 +326,16 @@ func PairMover(in ObjectPairChan, fdst Fs, wg *sync.WaitGroup) {
err := dst.Remove()
if err != nil {
Stats.Error()
ErrorLog(dst, "Couldn't delete: %s", err)
ErrorLog(dst, "Couldn't delete: %v", err)
}
}
fdstMover.Move(src, src.Remote())
Debug(src, "Moved")
_, err := fdstMover.Move(src, src.Remote())
if err != nil {
Stats.Error()
ErrorLog(dst, "Couldn't move: %v", err)
} else {
Debug(src, "Moved")
}
} else {
Copy(fdst, pair.dst, src)
}
@ -615,10 +620,12 @@ func ListFn(f Fs, fn func(Object)) error {
var outMutex sync.Mutex
// Synchronized fmt.Fprintf
func syncFprintf(w io.Writer, format string, a ...interface{}) (n int, err error) {
//
// Ignores errors from Fprintf
func syncFprintf(w io.Writer, format string, a ...interface{}) {
outMutex.Lock()
defer outMutex.Unlock()
return fmt.Fprintf(w, format, a...)
_, _ = fmt.Fprintf(w, format, a...)
}
// List the Fs to the supplied writer