ssh_config
ssh_config copied to clipboard
UserSettings functions should have the same signature as Config
I can't do something like this:
type sshconfig interface {
GetAll(alias, key string) ([]string, error)
}
var sshConfig sshconfig
func initSshConfig() {
if path := os.Getenv("SSH_CONFIG"); path != "" {
f, _ := os.Open(path)
cfg, _ := ssh_config.Decode(f)
sshConfig = c
return
}
sshConfig = ssh_config.DefaultUserSettings
}
==>
have GetAll(alias string, key string) []string
want GetAll(alias string, key string) ([]string, error)
~~I think I can use GetAllStrict~~ (no, ssh_config.Config does not have GetAllStrict)
Actually, I think what I want to do is overwrite UserSettings.userConfig
or UserSettings.configFinder
.
The only exposed setting is IgnoreErrors
.
Perhaps something like NewUserSettings(params)
.
edit a year later: i have no clue what i'm talking about in this comment.