From e4285f02c58896ace6b94c2c8ebd73291a691c33 Mon Sep 17 00:00:00 2001 From: Holger Obermaier <40787752+ho-ob@users.noreply.github.com> Date: Fri, 11 Feb 2022 15:34:12 +0100 Subject: [PATCH] Avoid one append --- sinks/gangliaSink.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sinks/gangliaSink.go b/sinks/gangliaSink.go index 714c5a4..c53b11a 100644 --- a/sinks/gangliaSink.go +++ b/sinks/gangliaSink.go @@ -113,20 +113,20 @@ func (s *GangliaSink) Write(point lp.CCMetric) error { if k == "value" { switch value := v.(type) { case float64: - argstr = append(argstr, fmt.Sprintf("--value=%v", value)) - argstr = append(argstr, "--type=double") + argstr = append(argstr, + fmt.Sprintf("--value=%v", value), "--type=double") case float32: - argstr = append(argstr, fmt.Sprintf("--value=%v", value)) - argstr = append(argstr, "--type=float") + argstr = append(argstr, + fmt.Sprintf("--value=%v", value), "--type=float") case int: - argstr = append(argstr, fmt.Sprintf("--value=%d", value)) - argstr = append(argstr, "--type=int32") + argstr = append(argstr, + fmt.Sprintf("--value=%d", value), "--type=int32") case int64: - argstr = append(argstr, fmt.Sprintf("--value=%d", value)) - argstr = append(argstr, "--type=int32") + argstr = append(argstr, + fmt.Sprintf("--value=%d", value), "--type=int32") case string: - argstr = append(argstr, fmt.Sprintf("--value=%q", value)) - argstr = append(argstr, "--type=string") + argstr = append(argstr, + fmt.Sprintf("--value=%q", value), "--type=string") } } }