aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/client
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-11-21 08:43:11 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2017-11-21 08:43:11 +0100
commit5eb1c562e7deb4191cb160af91a864fb783c1041 (patch)
tree090b3fef25c728381f384f9e04a86fa9905549c8 /plumbing/transport/client
parent90796406c0755f61761fb176cdfe6106f00d903c (diff)
downloadgo-git-5eb1c562e7deb4191cb160af91a864fb783c1041.tar.gz
*: add pointer to the new transport.Endpoint struct
Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
Diffstat (limited to 'plumbing/transport/client')
-rw-r--r--plumbing/transport/client/client.go8
-rw-r--r--plumbing/transport/client/client_test.go4
2 files changed, 6 insertions, 6 deletions
diff --git a/plumbing/transport/client/client.go b/plumbing/transport/client/client.go
index 76c1469..90635a5 100644
--- a/plumbing/transport/client/client.go
+++ b/plumbing/transport/client/client.go
@@ -34,14 +34,14 @@ func InstallProtocol(scheme string, c transport.Transport) {
// NewClient returns the appropriate client among of the set of known protocols:
// http://, https://, ssh:// and file://.
// See `InstallProtocol` to add or modify protocols.
-func NewClient(endpoint transport.Endpoint) (transport.Transport, error) {
- f, ok := Protocols[endpoint.Protocol()]
+func NewClient(endpoint *transport.Endpoint) (transport.Transport, error) {
+ f, ok := Protocols[endpoint.Protocol]
if !ok {
- return nil, fmt.Errorf("unsupported scheme %q", endpoint.Protocol())
+ return nil, fmt.Errorf("unsupported scheme %q", endpoint.Protocol)
}
if f == nil {
- return nil, fmt.Errorf("malformed client for scheme %q, client is defined as nil", endpoint.Protocol())
+ return nil, fmt.Errorf("malformed client for scheme %q, client is defined as nil", endpoint.Protocol)
}
return f, nil
diff --git a/plumbing/transport/client/client_test.go b/plumbing/transport/client/client_test.go
index 2b686b6..65cf574 100644
--- a/plumbing/transport/client/client_test.go
+++ b/plumbing/transport/client/client_test.go
@@ -59,12 +59,12 @@ type dummyClient struct {
*http.Client
}
-func (*dummyClient) NewUploadPackSession(transport.Endpoint, transport.AuthMethod) (
+func (*dummyClient) NewUploadPackSession(*transport.Endpoint, transport.AuthMethod) (
transport.UploadPackSession, error) {
return nil, nil
}
-func (*dummyClient) NewReceivePackSession(transport.Endpoint, transport.AuthMethod) (
+func (*dummyClient) NewReceivePackSession(*transport.Endpoint, transport.AuthMethod) (
transport.ReceivePackSession, error) {
return nil, nil
}