From ed0650a4bf6bf6364032ee68620933472eaec9aa Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Thu, 1 May 2025 15:00:39 -0400 Subject: [PATCH] fixes for nit-picky golang 1.24 toolchain --- CHANGELOG.md | 2 ++ cmd/zrok/accessPublic.go | 2 +- cmd/zrok/accessPublicValidate.go | 2 +- cmd/zrok/adminBootstrap.go | 2 +- cmd/zrok/adminGc.go | 2 +- cmd/zrok/adminUnbootstrap.go | 4 ++-- cmd/zrok/controller.go | 2 +- cmd/zrok/controllerMetricsBridge.go | 2 +- cmd/zrok/controllerValidate.go | 2 +- cmd/zrok/invite.go | 2 +- cmd/zrok/status.go | 4 ++-- sdk/golang/examples/pastebin/cmd/pastefrom/main.go | 2 +- 12 files changed, 15 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f7632a5..791ce4bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ REMOVED: The `websocket`-based OpenZiti metrics source has been removed. The pre CHANGE: `github.com/openziti/sdk-golang` has been updated to `v1.1.0`. Related dependencies and indirects also updated +CHANGE: Updated to `golang` `v1.24` as the official build toolchain + ## v1.0.3 FEATURE: `zrok agent console` now outputs the URL it is attempting to open. New `zrok agent console --headless` option to only emit the agent console URL (https://github.com/openziti/zrok/issues/944) diff --git a/cmd/zrok/accessPublic.go b/cmd/zrok/accessPublic.go index b70b68f8..da468f1d 100644 --- a/cmd/zrok/accessPublic.go +++ b/cmd/zrok/accessPublic.go @@ -41,7 +41,7 @@ func (cmd *accessPublicCommand) run(_ *cobra.Command, args []string) { panic(err) } } - logrus.Infof(cf.Dump(cfg, cf.DefaultOptions())) + logrus.Info(cf.Dump(cfg, cf.DefaultOptions())) frontend, err := publicProxy.NewHTTP(cfg) if err != nil { if !panicInstead { diff --git a/cmd/zrok/accessPublicValidate.go b/cmd/zrok/accessPublicValidate.go index e8760431..573355cd 100644 --- a/cmd/zrok/accessPublicValidate.go +++ b/cmd/zrok/accessPublicValidate.go @@ -33,5 +33,5 @@ func (cmd *accessPublicValidateCommand) run(_ *cobra.Command, args []string) { if err := cfg.Load(args[0]); err != nil { tui.Error(fmt.Sprintf("unable to load configuration '%v'", args[0]), err) } - logrus.Infof(cf.Dump(cfg, cf.DefaultOptions())) + logrus.Info(cf.Dump(cfg, cf.DefaultOptions())) } diff --git a/cmd/zrok/adminBootstrap.go b/cmd/zrok/adminBootstrap.go index e2e8416d..bdeab71d 100644 --- a/cmd/zrok/adminBootstrap.go +++ b/cmd/zrok/adminBootstrap.go @@ -35,7 +35,7 @@ func (cmd *adminBootstrap) run(_ *cobra.Command, args []string) { if err != nil { panic(err) } - logrus.Infof(cf.Dump(inCfg, cf.DefaultOptions())) + logrus.Info(cf.Dump(inCfg, cf.DefaultOptions())) if err := controller.Bootstrap(cmd.skipFrontend, inCfg); err != nil { panic(err) } diff --git a/cmd/zrok/adminGc.go b/cmd/zrok/adminGc.go index 4179d558..e6396465 100644 --- a/cmd/zrok/adminGc.go +++ b/cmd/zrok/adminGc.go @@ -32,7 +32,7 @@ func (gc *adminGcCommand) run(_ *cobra.Command, args []string) { if err != nil { panic(err) } - logrus.Infof(cf.Dump(cfg, cf.DefaultOptions())) + logrus.Info(cf.Dump(cfg, cf.DefaultOptions())) if err := controller.GC(cfg); err != nil { panic(err) } diff --git a/cmd/zrok/adminUnbootstrap.go b/cmd/zrok/adminUnbootstrap.go index 0efea607..4b0c9d0e 100644 --- a/cmd/zrok/adminUnbootstrap.go +++ b/cmd/zrok/adminUnbootstrap.go @@ -32,9 +32,9 @@ func (cmd *adminUnbootstrap) run(_ *cobra.Command, args []string) { if err != nil { panic(err) } - logrus.Infof(cf.Dump(cfg, cf.DefaultOptions())) + logrus.Info(cf.Dump(cfg, cf.DefaultOptions())) if err := controller.Unbootstrap(cfg); err != nil { panic(err) } - logrus.Infof("unbootstrap complete!") + logrus.Info("unbootstrap complete!") } diff --git a/cmd/zrok/controller.go b/cmd/zrok/controller.go index 2652a25b..7b559b82 100644 --- a/cmd/zrok/controller.go +++ b/cmd/zrok/controller.go @@ -42,7 +42,7 @@ func (cmd *controllerCommand) run(_ *cobra.Command, args []string) { if err != nil { panic(err) } - logrus.Infof(cf.Dump(cfg, cf.DefaultOptions())) + logrus.Info(cf.Dump(cfg, cf.DefaultOptions())) if err := controller.Run(cfg); err != nil { panic(err) } diff --git a/cmd/zrok/controllerMetricsBridge.go b/cmd/zrok/controllerMetricsBridge.go index 8d9fa28e..1e59a01f 100644 --- a/cmd/zrok/controllerMetricsBridge.go +++ b/cmd/zrok/controllerMetricsBridge.go @@ -37,7 +37,7 @@ func (cmd *bridgeCommand) run(_ *cobra.Command, args []string) { if err != nil { panic(err) } - logrus.Infof(cf.Dump(cfg, env.GetCfOptions())) + logrus.Info(cf.Dump(cfg, env.GetCfOptions())) bridge, err := metrics.NewBridge(cfg.Bridge) if err != nil { diff --git a/cmd/zrok/controllerValidate.go b/cmd/zrok/controllerValidate.go index bf632c29..c92729e3 100644 --- a/cmd/zrok/controllerValidate.go +++ b/cmd/zrok/controllerValidate.go @@ -32,5 +32,5 @@ func (cmd *controllerValidateCommand) run(_ *cobra.Command, args []string) { if err != nil { tui.Error("controller config validation failed", err) } - logrus.Infof(cf.Dump(cfg, cf.DefaultOptions())) + logrus.Info(cf.Dump(cfg, cf.DefaultOptions())) } diff --git a/cmd/zrok/invite.go b/cmd/zrok/invite.go index 9a545bcf..91b68605 100644 --- a/cmd/zrok/invite.go +++ b/cmd/zrok/invite.go @@ -87,7 +87,7 @@ func (cmd *inviteCommand) run(_ *cobra.Command, _ []string) { } fmt.Printf("invitation sent to '%v'!\n\n", email) - fmt.Printf(fmt.Sprintf("%v\n\n", tui.Attention.Render("*** be sure to check your SPAM folder if you do not receive the invitation email!"))) + fmt.Println(fmt.Sprintf("%v\n", tui.Attention.Render("*** be sure to check your SPAM folder if you do not receive the invitation email!"))) } } diff --git a/cmd/zrok/status.go b/cmd/zrok/status.go index 8fbea225..920b97f1 100644 --- a/cmd/zrok/status.go +++ b/cmd/zrok/status.go @@ -43,7 +43,7 @@ func (cmd *statusCommand) run(_ *cobra.Command, _ []string) { tui.Warning(fmt.Sprintf("Your environment is out of date ('%v'), use '%v' to update (make a backup before updating!)\n", env.Metadata().V, tui.Code.Render("zrok update"))) } - _, _ = fmt.Fprintf(os.Stdout, tui.Code.Render("Config")+":\n\n") + _, _ = fmt.Fprintln(os.Stdout, tui.Code.Render("Config")+":\n") t := table.NewWriter() t.SetOutputMirror(os.Stdout) t.SetStyle(table.StyleColoredDark) @@ -60,7 +60,7 @@ func (cmd *statusCommand) run(_ *cobra.Command, _ []string) { if !env.IsEnabled() { _, _ = fmt.Fprintf(os.Stderr, "To create a local environment use the %v command.\n", tui.Code.Render("zrok enable")) } else { - _, _ = fmt.Fprintf(os.Stdout, tui.Code.Render("Environment")+":\n\n") + _, _ = fmt.Fprintln(os.Stdout, tui.Code.Render("Environment")+":\n") t := table.NewWriter() t.SetOutputMirror(os.Stdout) diff --git a/sdk/golang/examples/pastebin/cmd/pastefrom/main.go b/sdk/golang/examples/pastebin/cmd/pastefrom/main.go index 55f9e9d9..334b5bb3 100644 --- a/sdk/golang/examples/pastebin/cmd/pastefrom/main.go +++ b/sdk/golang/examples/pastebin/cmd/pastefrom/main.go @@ -44,5 +44,5 @@ func main() { panic(err) } - fmt.Printf(string(buf[:n])) + fmt.Println(string(buf[:n])) }