Fix race in filesystem_test.go

This commit is contained in:
Matthew Penner
2020-10-17 15:31:40 -06:00
parent a62b588ace
commit 4ce35d3d17
3 changed files with 29 additions and 24 deletions

View File

@@ -209,7 +209,8 @@ func (fs *Filesystem) hasSpaceFor(size int64) error {
// Updates the disk usage for the Filesystem instance.
func (fs *Filesystem) addDisk(i int64) int64 {
var size = atomic.LoadInt64(&fs.diskUsed)
size := atomic.LoadInt64(&fs.diskUsed)
// Sorry go gods. This is ugly but the best approach I can come up with for right
// now without completely re-evaluating the logic we use for determining disk space.
//