From 45e3ce22763c4f359334bee51afaebdd0076b68c Mon Sep 17 00:00:00 2001 From: Kevin Schoonover Date: Thu, 23 Dec 2021 22:10:47 -0800 Subject: [PATCH] []HttpServer -> []*HTTPServer --- command/agent/command.go | 2 +- command/agent/http.go | 6 +++--- command/agent/testagent.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/command/agent/command.go b/command/agent/command.go index 8cfb64bb6737..0cdfc76aab82 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -51,7 +51,7 @@ type Command struct { args []string agent *Agent - httpServers []HTTPServer + httpServers []*HTTPServer logFilter *logutils.LevelFilter logOutput io.Writer retryJoinErrCh chan struct{} diff --git a/command/agent/http.go b/command/agent/http.go index 78f477d1dfdc..96e3f5842490 100644 --- a/command/agent/http.go +++ b/command/agent/http.go @@ -78,8 +78,8 @@ type HTTPServer struct { // NewHTTPServers starts an HTTP server for every address.http configured in // the agent. -func NewHTTPServers(agent *Agent, config *Config) ([]HTTPServer, error) { - var srvs []HTTPServer +func NewHTTPServers(agent *Agent, config *Config) ([]*HTTPServer, error) { + var srvs []*HTTPServer var serverInitializationErrors error // Handle requests with gzip compression @@ -166,7 +166,7 @@ func NewHTTPServers(agent *Agent, config *Config) ([]HTTPServer, error) { httpServer.Serve(ln) }() - srvs = append(srvs, *srv) + srvs = append(srvs, srv) } if serverInitializationErrors != nil { diff --git a/command/agent/testagent.go b/command/agent/testagent.go index 1fd5811ba198..18c463213ae6 100644 --- a/command/agent/testagent.go +++ b/command/agent/testagent.go @@ -68,7 +68,7 @@ type TestAgent struct { // All HTTP servers started. Used to prevent server leaks and preserve // backwards compability. - Servers []HTTPServer + Servers []*HTTPServer // Server is a reference to the primary, started HTTP endpoint. // It is valid after Start(). @@ -267,7 +267,7 @@ func (a *TestAgent) start() (*Agent, error) { // TODO: investigate if there is a way to remove the requirement by updating test. // Initial pass at implementing this is https://github.com/kevinschoonover/nomad/tree/tests. a.Servers = httpServers - a.Server = &httpServers[0] + a.Server = httpServers[0] return agent, nil }