all: Even more boring linter fixes (#5501)

This commit is contained in:
Jakob Borg
2019-02-02 11:45:17 +01:00
committed by GitHub
parent df5c1eaf01
commit 0b2cabbc31
28 changed files with 131 additions and 104 deletions

View File

@@ -17,7 +17,7 @@ import (
"time"
"unicode/utf8"
"github.com/rcrowley/go-metrics"
metrics "github.com/rcrowley/go-metrics"
"github.com/syncthing/syncthing/lib/events"
"github.com/syncthing/syncthing/lib/fs"
"github.com/syncthing/syncthing/lib/ignore"
@@ -108,10 +108,10 @@ func (w *walker) walk(ctx context.Context) chan ScanResult {
go func() {
hashFiles := w.walkAndHashFiles(ctx, toHashChan, finishedChan)
if len(w.Subs) == 0 {
w.Filesystem.Walk(".", hashFiles)
_ = w.Filesystem.Walk(".", hashFiles)
} else {
for _, sub := range w.Subs {
w.Filesystem.Walk(sub, hashFiles)
_ = w.Filesystem.Walk(sub, hashFiles)
}
}
close(toHashChan)
@@ -223,7 +223,7 @@ func (w *walker) walkAndHashFiles(ctx context.Context, toHashChan chan<- protoco
if fs.IsTemporary(path) {
l.Debugln("temporary:", path, "err:", err)
if err == nil && info.IsRegular() && info.ModTime().Add(w.TempLifetime).Before(now) {
w.Filesystem.Remove(path)
_ = w.Filesystem.Remove(path)
l.Debugln("removing temporary:", path, info.ModTime())
}
return nil