From c4d4e0a21fccdd1ba4766aa62a37594e78bef482 Mon Sep 17 00:00:00 2001 From: Emil Hessman Date: Mon, 15 Dec 2014 19:54:44 +0100 Subject: [PATCH] communicator/ssh: bind variable value to closure Fixes the following vet report: communicator/ssh/communicator_test.go:88: range variable newChannel captured by func literal --- communicator/ssh/communicator_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/communicator/ssh/communicator_test.go b/communicator/ssh/communicator_test.go index c5b8832dd..aa241cca8 100644 --- a/communicator/ssh/communicator_test.go +++ b/communicator/ssh/communicator_test.go @@ -83,10 +83,10 @@ func newMockLineServer(t *testing.T) string { } t.Log("Accepted channel") - go func() { + go func(channelType string) { defer channel.Close() - conn.OpenChannel(newChannel.ChannelType(), nil) - }() + conn.OpenChannel(channelType, nil) + }(newChannel.ChannelType()) } conn.Close() }()