Skip to content

Commit

Permalink
[]HttpServer -> []*HTTPServer
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinschoonover committed Dec 31, 2021
1 parent 738ea8f commit 3e5169f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion command/agent/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type Command struct {

args []string
agent *Agent
httpServers []HTTPServer
httpServers []*HTTPServer
logFilter *logutils.LevelFilter
logOutput io.Writer
retryJoinErrCh chan struct{}
Expand Down
6 changes: 3 additions & 3 deletions command/agent/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions command/agent/testagent.go
Original file line number Diff line number Diff line change
Expand Up @@ -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().
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 3e5169f

Please sign in to comment.