mirror of
https://github.com/hashicorp/packer.git
synced 2026-02-23 01:40:26 -05:00
15 lines
397 B
Go
15 lines
397 B
Go
package ssh
|
|
|
|
import (
|
|
"net"
|
|
"time"
|
|
)
|
|
|
|
// ConnectFunc is a convenience method for returning a function
|
|
// that just uses net.Dial to communicate with the remote end that
|
|
// is suitable for use with the SSH communicator configuration.
|
|
func ConnectFunc(network, addr string) func() (net.Conn, error) {
|
|
return func() (net.Conn, error) {
|
|
return net.DialTimeout(network, addr, 15*time.Second)
|
|
}
|
|
}
|