From f0d1722bbd51849e768b516318d599ece9248a96 Mon Sep 17 00:00:00 2001 From: Kevin Wan Date: Sat, 24 Dec 2022 11:41:23 +0800 Subject: [PATCH] chore: pass by value for config in dev server (#2712) --- internal/devserver/server.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/devserver/server.go b/internal/devserver/server.go index 49c87dad..efeb160c 100644 --- a/internal/devserver/server.go +++ b/internal/devserver/server.go @@ -19,13 +19,13 @@ var once sync.Once // Server is inner http server, expose some useful observability information of app. // For example health check, metrics and pprof. type Server struct { - config *Config + config Config server *http.ServeMux routes []string } // NewServer returns a new inner http Server. -func NewServer(config *Config) *Server { +func NewServer(config Config) *Server { return &Server{ config: config, server: http.NewServeMux(), @@ -76,7 +76,7 @@ func (s *Server) StartAsync() { func StartAgent(c Config) { once.Do(func() { if c.Enabled { - s := NewServer(&c) + s := NewServer(c) s.StartAsync() } })