-
Notifications
You must be signed in to change notification settings - Fork 181
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
Fix for home directory not found on Windows #44
base: master
Are you sure you want to change the base?
Conversation
After cross-compiling `gof3r` for `windows/amd64` and running the binary I got the following error, home directory not found for current user The fix for this error is to use the third-party package `go-homedir`, which detects "the user's home directory without the use of cgo, so the library can be used in cross-compilation environments."
I tested the fix on I used gox to cross-compile, e.g. |
Since I have not tested s3gof3r all on windows, I'd like to have more evidence it works correctly in general on windows before adding windows-specific code changes like this. If windows support is possible without significant changes to the existing code, it's certainly worth pursuing though. Regarding this change specifically, I'd prefer not to introduce an entire 200+ line library dependency for the few lines of code it would take to add windows home dir support. The code could be included with proper attribution instead. |
Noting this here in so far as it is [edit1]may be[/edit1] useful: At least the commandline gof3r works fine so long as the HOME envar is defined (just did However, I was able to run it without it complaining. I imagine that simply falling back on the value of |
Actually, |
@mentalisttraceur Thanks for the info, that's a good idea to gracefully degrade on windows and possibly also support If you're interested in helping make this change, a pull request would be welcome. I don't have an easily-available windows system to test the change on so it might be a while before I can set one up. |
After cross-compiling
gof3r
forwindows/amd64
and running the binaryI got the following error,
home directory not found for current user
The fix for this error is to use the third-party package
go-homedir
, whichdetects "the user's home directory without the use of cgo, so the library
can be used in cross-compilation environments."