Make tiny variable optimization
This commit was merged in pull request #1.
This commit is contained in:
@@ -19,16 +19,11 @@ func getConfigDir(n string) string {
|
|||||||
// Find config directory
|
// Find config directory
|
||||||
|
|
||||||
// Linux (XDG base directory specification compliant)
|
// Linux (XDG base directory specification compliant)
|
||||||
xdg_config_home := os.Getenv("XDG_CONFIG_HOME")
|
if xdg_config_home := os.Getenv("XDG_CONFIG_HOME"); xdg_config_home != "" {
|
||||||
|
return filepath.Join(xdg_config_home, n)
|
||||||
var base string
|
|
||||||
if xdg_config_home != "" {
|
|
||||||
base = xdg_config_home
|
|
||||||
} else {
|
|
||||||
home := os.Getenv("HOME")
|
|
||||||
base = filepath.Join(home, ".config")
|
|
||||||
}
|
}
|
||||||
return filepath.Join(base, n)
|
|
||||||
|
return filepath.Join(os.Getenv("HOME"), ".config", n)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Config[T]) Get() (bool, error) {
|
func (c *Config[T]) Get() (bool, error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user