Cache the Path() call, as it's quite expensive and called a lot

This commit is contained in:
Jakob Borg
2015-11-05 08:31:36 +00:00
parent 36f6a9347c
commit 34aa41e17b
3 changed files with 43 additions and 23 deletions

View File

@@ -104,6 +104,13 @@ func TestDeviceConfig(t *testing.T) {
},
}
// The cachedPath will have been resolved to an absolute path,
// depending on where the tests are running. Zero it out so we don't
// fail based on that.
for i := range cfg.Folders {
cfg.Folders[i].cachedPath = ""
}
if runtime.GOOS != "windows" {
expectedFolders[0].RawPath += string(filepath.Separator)
}