chore: refactors config.path (small)

Performs a minor refactoring on `config.Paths` to consistently use
`path.Join` when computing config directory paths. Previously, both
`path.Join` and `fmt.Sprintf` were being used, strictly due to an
oversight.
This commit is contained in:
Chris Lane 2020-01-30 19:45:02 -05:00
parent 8a313b92ca
commit 408e944eea

View File

@ -32,8 +32,8 @@ func Paths(sys string, envvars map[string]string) ([]string, error) {
}, nil
case "windows":
return []string{
fmt.Sprintf("%s/cheat/conf.yml", envvars["APPDATA"]),
fmt.Sprintf("%s/cheat/conf.yml", envvars["PROGRAMDATA"]),
path.Join(envvars["APPDATA"], "/cheat/conf.yml"),
path.Join(envvars["PROGRAMDATA"], "/cheat/conf.yml"),
}, nil
default:
return []string{}, fmt.Errorf("unsupported os: %s", sys)