From f13cc53ac0b7fcd67edfe849112009f15463d5d6 Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Wed, 7 Dec 2016 10:50:32 -0800 Subject: [PATCH 1/2] Abolish WithRegistry --- transport/http/inbound.go | 7 ------- transport/http/inbound_test.go | 6 +++--- transport/tchannel/inbound.go | 7 ------- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/transport/http/inbound.go b/transport/http/inbound.go index 402dfc08f1..80e0d5d21a 100644 --- a/transport/http/inbound.go +++ b/transport/http/inbound.go @@ -66,13 +66,6 @@ func (i *Inbound) WithTracer(tracer opentracing.Tracer) *Inbound { return i } -// WithRegistry configures a registry to handle incoming requests, -// as a chained method for convenience. -func (i *Inbound) WithRegistry(registry transport.Registry) *Inbound { - i.registry = registry - return i -} - // SetRegistry configures a registry to handle incoming requests. // This satisfies the transport.Inbound interface, and would be called // by a dispatcher when it starts. diff --git a/transport/http/inbound_test.go b/transport/http/inbound_test.go index 33a910c634..3bba9e1525 100644 --- a/transport/http/inbound_test.go +++ b/transport/http/inbound_test.go @@ -85,9 +85,9 @@ func TestInboundStartAndStop(t *testing.T) { func TestInboundStartError(t *testing.T) { x := NewTransport() - err := x.NewInbound("invalid"). - WithRegistry(new(transporttest.MockRegistry)). - Start() + i := x.NewInbound("invalid") + i.SetRegistry(new(transporttest.MockRegistry)) + err := i.Start() assert.Error(t, err, "expected failure") } diff --git a/transport/tchannel/inbound.go b/transport/tchannel/inbound.go index 72fb4953b6..310c8c80f4 100644 --- a/transport/tchannel/inbound.go +++ b/transport/tchannel/inbound.go @@ -65,13 +65,6 @@ func (i *Inbound) WithTracer(tracer opentracing.Tracer) *Inbound { return i } -// WithRegistry configures a registry to handle incoming requests, -// as a chained method for convenience. -func (i *Inbound) WithRegistry(registry transport.Registry) *Inbound { - i.registry = registry - return i -} - // SetRegistry configures a registry to handle incoming requests. // This satisfies the transport.Inbound interface, and would be called // by a dispatcher when it starts. From 2943e4c93284edac595af5f3793d0c31e1fdc631 Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Wed, 7 Dec 2016 10:28:14 -0800 Subject: [PATCH 2/2] [End of remove-with-registry]