MCPcopy Create free account
hub / github.com/Driver-C/tryssh / formatRemotePath

Function formatRemotePath

pkg/control/scp.go:54–59  ·  view source on GitHub ↗

formatRemotePath builds a "host:path" string, wrapping IPv6 addresses in brackets.

(host, path string)

Source from the content-addressed store, hash-verified

52
53// formatRemotePath builds a "host:path" string, wrapping IPv6 addresses in brackets.
54func formatRemotePath(host, path string) string {
55 if strings.Contains(host, ":") {
56 return "[" + host + "]:" + path
57 }
58 return host + ":" + path
59}
60
61// TryCopy attempts to copy files to/from the target server, first using cached
62// credentials and then by trying all credential combinations.

Calls

no outgoing calls