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
Making defaultPath evaluation lazy #8
Comments
I am using this workaround now: func getConnection(target DeploymentTarget) (*goph.Client, error) {
callback, err := goph.KnownHosts(os.ExpandEnv("$HOME/.ssh/known_hosts"))
if err == nil {
client, err := goph.NewConn(&goph.Config{
User: target.Config.User,
Addr: target.Config.Address,
Port: 22,
Auth: goph.Password(target.Config.Password),
Timeout: goph.DefaultTimeout,
Callback: callback,
})
if err == nil {
return client, nil
}
}
return nil, err
} |
Merged
hi, thanks for your report. |
that would probably work but |
changed to os UserHomeDir |
@melbahja thank you |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would you consider wrapping
defaultPath
in a function? The issue is on Windows environmentsHOME
is not set by default. Simple solution would be setting it manually when the program starts:but it doesn't get recognized by goph since it is evaluated beforehand.
The text was updated successfully, but these errors were encountered: