all repos — website @ 3510170ca4fdc60a212dd7519596f9f7dd502998

My website

refactor: remove unnecessary package-global variable
Alan Pearce alan@alanpearce.eu
Fri, 24 May 2024 23:07:36 +0200
commit

3510170ca4fdc60a212dd7519596f9f7dd502998

parent

6a822598a5af45317f48f647e03c020c3a58b9c3

1 files changed, 1 insertions(+), 3 deletions(-)

jump to
M internal/server/server.gointernal/server/server.go
@@ -20,8 +20,6 @@ "golang.org/x/net/http2" 	"golang.org/x/net/http2/h2c"
 )
 
-var config *cfg.Config
-
 var (
 	CommitSHA    = "local"
 	ShortSHA     = "local"
@@ -55,7 +53,7 @@ } 
 func New(runtimeConfig *Config) (*Server, error) {
 	var err error
-	config, err = cfg.GetConfig()
+	config, err := cfg.GetConfig()
 	if err != nil {
 		return nil, errors.WithMessage(err, "error parsing configuration file")
 	}