Use Dial with context

This commit is contained in:
Mikhail Mazurskiy
2018-05-19 08:14:37 +10:00
parent 77a08ee2d7
commit 5e8e570dbd
25 changed files with 111 additions and 110 deletions

View File

@@ -17,6 +17,7 @@ limitations under the License.
package ssh
import (
"context"
"fmt"
"io"
"net"
@@ -145,7 +146,7 @@ func TestSSHTunnel(t *testing.T) {
t.FailNow()
}
_, err = tunnel.Dial("tcp", "127.0.0.1:8080")
_, err = tunnel.Dial(context.Background(), "tcp", "127.0.0.1:8080")
if err != nil {
t.Errorf("unexpected error: %v", err)
}
@@ -176,7 +177,7 @@ func (*fakeTunnel) Close() error {
return nil
}
func (*fakeTunnel) Dial(network, address string) (net.Conn, error) {
func (*fakeTunnel) Dial(ctx context.Context, network, address string) (net.Conn, error) {
return nil, nil
}