From f6f1d88969e12eadb7013397cdad3c4c5625988c Mon Sep 17 00:00:00 2001 From: Jeff Halter <868228+jhalter@users.noreply.github.com> Date: Sat, 15 Jun 2024 11:17:55 -0700 Subject: [PATCH] Replace hardcoded version with ldflag usage --- cmd/mobius-hotline-server/main.go | 6 ++++++ hotline/server.go | 6 ------ hotline/version.go | 3 --- 3 files changed, 6 insertions(+), 9 deletions(-) delete mode 100644 hotline/version.go diff --git a/cmd/mobius-hotline-server/main.go b/cmd/mobius-hotline-server/main.go index 8e66938..66566cd 100644 --- a/cmd/mobius-hotline-server/main.go +++ b/cmd/mobius-hotline-server/main.go @@ -122,6 +122,12 @@ func main() { }(srv) } + slogger.Info("Hotline server started", + "version", version, + "API port", fmt.Sprintf("%s:%v", *netInterface, *basePort), + "Transfer port", fmt.Sprintf("%s:%v", *netInterface, *basePort+1), + ) + // Serve Hotline requests until program exit log.Fatal(srv.ListenAndServe(ctx, cancel)) } diff --git a/hotline/server.go b/hotline/server.go index b4841a7..ff8daf3 100644 --- a/hotline/server.go +++ b/hotline/server.go @@ -92,12 +92,6 @@ type PrivateChat struct { } func (s *Server) ListenAndServe(ctx context.Context, cancelRoot context.CancelFunc) error { - s.Logger.Info("Hotline server started", - "version", VERSION, - "API port", fmt.Sprintf("%s:%v", s.NetInterface, s.Port), - "Transfer port", fmt.Sprintf("%s:%v", s.NetInterface, s.Port+1), - ) - var wg sync.WaitGroup wg.Add(1) diff --git a/hotline/version.go b/hotline/version.go deleted file mode 100644 index 3d7e9af..0000000 --- a/hotline/version.go +++ /dev/null @@ -1,3 +0,0 @@ -package hotline - -const VERSION = "0.12.3"