Skip to content

Commit f105e96

Browse files
committed
cli/connhelper: don't parse URL twice
This function was parsing the same URL twice; first to detect the scheme, then again (through ssh.ParseURL) to construct a ssh.Spec. Change the function to use the URL that's parsed, and use ssh.NewSpec instead. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 11b53da commit f105e96

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cli/connhelper/connhelper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func getConnectionHelper(daemonURL string, sshFlags []string) (*ConnectionHelper
4141
return nil, err
4242
}
4343
if u.Scheme == "ssh" {
44-
sp, err := ssh.ParseURL(daemonURL)
44+
sp, err := ssh.NewSpec(u)
4545
if err != nil {
4646
return nil, fmt.Errorf("ssh host connection is not valid: %w", err)
4747
}

0 commit comments

Comments
 (0)