From 3b7816ac115d6ea23b9d5c7ca595548f59b6c805 Mon Sep 17 00:00:00 2001 From: Abdul Matin Date: Mon, 21 Jul 2025 18:42:45 +0600 Subject: [PATCH] Fix the wrong variable name in standard_library.go.tmpl Using 'NewServer' as a variable reference is incorrect. This should be 'newServer' (the local variable) instead of 'NewServer' (which refers to the function name). Signed-off-by: shiponcs --- .../framework/files/server/standard_library.go.tmpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/template/framework/files/server/standard_library.go.tmpl b/cmd/template/framework/files/server/standard_library.go.tmpl index 09c731d7e..0e2c67fec 100644 --- a/cmd/template/framework/files/server/standard_library.go.tmpl +++ b/cmd/template/framework/files/server/standard_library.go.tmpl @@ -22,7 +22,7 @@ type Server struct { func NewServer() *http.Server { port, _ := strconv.Atoi(os.Getenv("PORT")) - NewServer := &Server{ + newServer := &Server{ port: port, {{if ne .DBDriver "none"}} db: database.New(), @@ -31,8 +31,8 @@ func NewServer() *http.Server { // Declare Server config server := &http.Server{ - Addr: fmt.Sprintf(":%d", NewServer.port), - Handler: NewServer.RegisterRoutes(), + Addr: fmt.Sprintf(":%d", newServer.port), + Handler: newServer.RegisterRoutes(), IdleTimeout: time.Minute, ReadTimeout: 10 * time.Second, WriteTimeout: 30 * time.Second,