diff options
author | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2019-08-16 14:14:54 +0300 |
---|---|---|
committer | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2019-08-16 14:14:54 +0300 |
commit | b66d53834a205dd3dafc14359d9cdebf9ea69534 (patch) | |
tree | b13d446dbd213a3acf073dcf880df7701f4f7e4a | |
parent | 5b2a44c5e0ff868d79d9d7fccbab462ebe5b5baf (diff) |
Have Gitaly compile again
Two merge requests got merged touching the same function in Go. This
lead to a state where `err` was already defined while later it was
assigned to with the `:=` notation, which implied it wasn't.
Merge requests in question:
1. https://gitlab.com/gitlab-org/gitaly/merge_requests/1431
2. https://gitlab.com/gitlab-org/gitaly/merge_requests/1424
-rw-r--r-- | internal/cache/walker.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/cache/walker.go b/internal/cache/walker.go index e70ee8846..6e0ba685a 100644 --- a/internal/cache/walker.go +++ b/internal/cache/walker.go @@ -22,7 +22,7 @@ func cleanWalk(storageName string) error { return err } - err := filepath.Walk(cachePath, func(path string, info os.FileInfo, err error) error { + walkErr := filepath.Walk(cachePath, func(path string, info os.FileInfo, err error) error { if err != nil { return err } @@ -53,11 +53,11 @@ func cleanWalk(storageName string) error { return nil }) - if os.IsNotExist(err) { + if os.IsNotExist(walkErr) { return nil } - return err + return walkErr } const cleanWalkFrequency = 10 * time.Minute |