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:
parent
952ae5161b
commit
c4d4e0a21f
|
@ -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()
|
||||
}()
|
||||
|
|
Loading…
Reference in New Issue