diff --git a/transport/http/server.go b/transport/http/server.go index 15dc0b57a..da8a29fe6 100644 --- a/transport/http/server.go +++ b/transport/http/server.go @@ -91,13 +91,6 @@ func ErrorEncoder(en EncodeErrorFunc) ServerOption { } } -// Endpoint with server endpoint. -func Endpoint(endpoint *url.URL) ServerOption { - return func(o *Server) { - o.endpoint = endpoint - } -} - // TLSConfig with TLS config. func TLSConfig(c *tls.Config) ServerOption { return func(o *Server) { @@ -227,9 +220,6 @@ func (s *Server) filter() mux.MiddlewareFunc { // http://127.0.0.1:8000?isSecure=false func (s *Server) Endpoint() (*url.URL, error) { s.once.Do(func() { - if s.endpoint != nil { - return - } lis, err := net.Listen(s.network, s.address) if err != nil { s.err = err diff --git a/transport/http/server_test.go b/transport/http/server_test.go index 69a2ceb00..5be44e8a2 100644 --- a/transport/http/server_test.go +++ b/transport/http/server_test.go @@ -7,7 +7,6 @@ import ( "fmt" "io/ioutil" "net/http" - "net/url" "strings" "testing" "time" @@ -201,15 +200,6 @@ func TestLogger(t *testing.T) { // todo } -func TestEndpoint(t *testing.T) { - u, err := url.Parse("http://hello/world") - assert.NoError(t, err) - o := &Server{} - Endpoint(u)(o) - assert.Equal(t, "hello", o.endpoint.Host) - assert.Equal(t, "http", o.endpoint.Scheme) -} - func TestMiddleware(t *testing.T) { o := &Server{} v := []middleware.Middleware{