From: Jeff Halter Date: Sat, 15 Jun 2024 18:17:55 +0000 (-0700) Subject: Replace hardcoded version with ldflag usage X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/commitdiff_plain/f6f1d88969e12eadb7013397cdad3c4c5625988c Replace hardcoded version with ldflag usage --- 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"