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
This commit is contained in:
Emil Hessman 2014-12-15 19:54:44 +01:00
parent 952ae5161b
commit c4d4e0a21f

View file

@ -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()
}()