Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified config to utilize the os.UserHomeDir() vs user.Current().HomeDir #52

Merged
merged 2 commits into from
Mar 16, 2021

Conversation

ZacWolf
Copy link
Contributor

@ZacWolf ZacWolf commented Mar 16, 2021

Changed from user.Current().HomeDir to us the go function: os.UserHomeDir()

This change allows users to modify their home directory via environment variables (plan9 on Unix, and %USERPROFILE% on windows), vs mandating the OS-specified "current" user setting be used. This allows a more "portable" use of your application.

For more info on this function see:
https://golang.org/src/os/file.go?s=14576:14610#L483

ZacWolf added 2 commits March 16, 2021 14:28
Modify config.go to use os.UserHomeDir() function which supports env variables vs mandating CurrentUser
Modifed to use the os.UserHomeDir() function to take into consideration user's ENV variables, and XDG Base Directory Specification
@marcosnils marcosnils self-requested a review March 16, 2021 19:52
@marcosnils marcosnils merged commit be73ea5 into marcosnils:master Mar 16, 2021
@marcosnils
Copy link
Owner

Preciate the contribution Zac, will craft a release with some updates later today 🤗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants