From 40efcb9a6e63a3f542de337cd9e3fc3b028fcf3d Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Thu, 11 Feb 2021 14:37:02 -0500 Subject: [PATCH] strings.join. (#184) --- router/forwarder/faulter.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/router/forwarder/faulter.go b/router/forwarder/faulter.go index 29225c2d3..6672f1f3a 100644 --- a/router/forwarder/faulter.go +++ b/router/forwarder/faulter.go @@ -22,6 +22,7 @@ import ( "github.com/openziti/foundation/channel2" cmap "github.com/orcaman/concurrent-map" "github.com/sirupsen/logrus" + "strings" "time" ) @@ -64,13 +65,7 @@ func (self *Faulter) run() { self.sessionIds.Remove(sessionId) } - sessionIds := workload[0] - for i, sessionId := range workload { - if i > 0 { - sessionIds += " " + sessionId - } - } - + sessionIds := strings.Join(workload, " ") fault := &ctrl_pb.Fault{Subject: ctrl_pb.FaultSubject_ForwardFault, Id: sessionIds} body, err := proto.Marshal(fault) if err == nil {