overwriteUserConfigDir sets the user config directory and the user home directory based on the os.UserConfigDir logic.
(t *testing.T, path string)
| 580 | // overwriteUserConfigDir sets the user config directory and the user home directory |
| 581 | // based on the os.UserConfigDir logic. |
| 582 | func overwriteUserConfigDir(t *testing.T, path string) { |
| 583 | switch runtime.GOOS { |
| 584 | case "windows": |
| 585 | t.Setenv("AppData", path) |
| 586 | case "plan9": // This adds "/lib" as a suffix to $home |
| 587 | t.Setenv("home", path) |
| 588 | default: // Unix |
| 589 | t.Setenv("XDG_CONFIG_HOME", path) |
| 590 | t.Setenv("HOME", path) |
| 591 | } |
| 592 | } |
| 593 | |
| 594 | // Make sure that on all supported platforms but Windows, XDG_CONFIG_HOME |
| 595 | // can be used to specify the user's home directory. For most platforms |
no outgoing calls
no test coverage detected