From 550bd9a8e62e05546d438e2c90aca1d033cce3c1 Mon Sep 17 00:00:00 2001 From: Zack Date: Fri, 20 Oct 2017 19:51:02 -0600 Subject: [PATCH] Only print if main thread --- connect.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/connect.go b/connect.go index 360f742..405fcf5 100644 --- a/connect.go +++ b/connect.go @@ -202,7 +202,9 @@ func (c *Connection) runClient() error { logger.Debug("waiting for ok from relay") message = receiveMessage(connection) if message == "no" { - fmt.Println("The specifed code is already in use by a sender.") + if id == 0 { + fmt.Println("The specifed code is already in use by a sender.") + } gotConnectionInUse = true } else { logger.Debug("got ok from relay") @@ -221,7 +223,9 @@ func (c *Connection) runClient() error { logger.Debug("waiting for meta data from sender") message = receiveMessage(connection) if message == "no" { - fmt.Println("The specifed code is already in use by a receiver.") + if id == 0 { + fmt.Println("The specifed code is already in use by a sender.") + } gotConnectionInUse = true } else { m := strings.Split(message, "-")