fix condition error

This commit is contained in:
xdrm-brackets 2018-04-28 18:08:36 +02:00
parent 2d220fc34b
commit 1df592cb81
1 changed files with 3 additions and 1 deletions

View File

@ -23,7 +23,9 @@ func main(){
select { select {
case receivedFrame := <- receiver: case receivedFrame := <- receiver:
fmt.Printf("[default] received '%s'\n", receivedFrame.Payload.Buffer) fmt.Printf("[default] received '%s'\n", receivedFrame.Payload.Buffer)
if receivedFrame.Payload.Length > 0 {
sender <- receivedFrame.Payload.Buffer[1:] sender <- receivedFrame.Payload.Buffer[1:]
}
case closeFunc := <- closer: case closeFunc := <- closer:
fmt.Printf("[default] client with protocol '%s' exited\n", client.Protocol) fmt.Printf("[default] client with protocol '%s' exited\n", client.Protocol)
closeFunc() closeFunc()