From f9839f7b1d1bfd215dcd105681d35c4fdf5d6c91 Mon Sep 17 00:00:00 2001 From: Timo Reimann Date: Mon, 15 May 2017 23:53:35 +0200 Subject: [PATCH] Turn configureBackends into method. --- server/server.go | 4 ++-- server/server_test.go | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/server/server.go b/server/server.go index e1465db2c..ad7b64876 100644 --- a/server/server.go +++ b/server/server.go @@ -255,7 +255,7 @@ func (server *Server) defaultConfigurationValues(configuration *types.Configurat return } server.configureFrontends(configuration.Frontends) - configureBackends(configuration.Backends) + server.configureBackends(configuration.Backends) } func (server *Server) listenConfigurations(stop chan bool) { @@ -889,7 +889,7 @@ func (server *Server) configureFrontends(frontends map[string]*types.Frontend) { } } -func configureBackends(backends map[string]*types.Backend) { +func (*Server) configureBackends(backends map[string]*types.Backend) { for backendName, backend := range backends { _, err := types.NewLoadBalancerMethod(backend.LoadBalancer) if err != nil { diff --git a/server/server_test.go b/server/server_test.go index 9c4d6bdf9..cb4c2d6d9 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -341,7 +341,8 @@ func TestConfigureBackends(t *testing.T) { LoadBalancer: test.lb, } - configureBackends(map[string]*types.Backend{ + srv := Server{} + srv.configureBackends(map[string]*types.Backend{ "backend": backend, })