fix: 'gocritic: filepathJoin path seperator' lint error

Signed-off-by: George Jenkins <gvjenkins@gmail.com>
pull/32370/head
George Jenkins 1 week ago
parent 1367d76f0a
commit 96a25ab4f8
No known key found for this signature in database
GPG Key ID: D79D67C9EC016739

@ -36,13 +36,12 @@ func TestDataPath(t *testing.T) {
os.Unsetenv(xdg.DataHomeEnvVar)
expected := filepath.Join(homedir.HomeDir(), "Library", appName, testFile)
assert.Equal(t, expected, lazy.dataPath(testFile))
t.Setenv(xdg.DataHomeEnvVar, "/tmp")
expected = filepath.Join("/tmp", appName, testFile)
tmpDir := t.TempDir()
t.Setenv(xdg.DataHomeEnvVar, tmpDir)
expected = filepath.Join(tmpDir, appName, testFile)
assert.Equal(t, expected, lazy.dataPath(testFile))
}
@ -50,13 +49,12 @@ func TestConfigPath(t *testing.T) {
os.Unsetenv(xdg.ConfigHomeEnvVar)
expected := filepath.Join(homedir.HomeDir(), "Library", "Preferences", appName, testFile)
assert.Equal(t, expected, lazy.configPath(testFile))
t.Setenv(xdg.ConfigHomeEnvVar, "/tmp")
expected = filepath.Join("/tmp", appName, testFile)
tmpDir := t.TempDir()
t.Setenv(xdg.ConfigHomeEnvVar, tmpDir)
expected = filepath.Join(tmpDir, appName, testFile)
assert.Equal(t, expected, lazy.configPath(testFile))
}
@ -64,12 +62,11 @@ func TestCachePath(t *testing.T) {
os.Unsetenv(xdg.CacheHomeEnvVar)
expected := filepath.Join(homedir.HomeDir(), "Library", "Caches", appName, testFile)
assert.Equal(t, expected, lazy.cachePath(testFile))
t.Setenv(xdg.CacheHomeEnvVar, "/tmp")
expected = filepath.Join("/tmp", appName, testFile)
tmpDir := t.TempDir()
t.Setenv(xdg.CacheHomeEnvVar, tmpDir)
expected = filepath.Join(tmpDir, appName, testFile)
assert.Equal(t, expected, lazy.cachePath(testFile))
}

Loading…
Cancel
Save