From f7c5adf5662c6dbb9c9a520b7c5e7629403ed181 Mon Sep 17 00:00:00 2001 From: Paul-Christian Volkmer Date: Fri, 13 Jan 2023 23:00:07 +0100 Subject: [PATCH] Format host string instead of concatenation --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index c5b0832..0054786 100644 --- a/main.go +++ b/main.go @@ -178,13 +178,13 @@ func getClientOpts(h *string) []client.Opt { // TCP/HTTP if !strings.Contains(*h, "//") { - *h = "tcp://" + *h + *h = fmt.Sprintf("tcp://%s", *h) } if u, err := client.ParseHostURL(*h); err == nil { if u.Port() != "" { opts = append(opts, client.WithHost(*h)) } else { - opts = append(opts, client.WithHost(*h+":2375")) + opts = append(opts, client.WithHost(fmt.Sprintf("%s:2375", *h))) } } else { log.Fatal(err)