@@ -99,14 +99,14 @@ func (c *Connection) InternalSend(inc bool, text string) error {
9999 // Test if connection is still healthy.
100100 _ , err := conn .Write ([]byte ("> ping <\r \n " ))
101101 if err != nil {
102- return fmt .Errorf ("sending ping to node '%s' failed: %s " , conn .RemoteAddr ().String (), err . Error () )
102+ return fmt .Errorf ("sending ping to node '%s' failed: %v " , conn .RemoteAddr ().String (), err )
103103 }
104104
105105 // Write message to TLS connections.
106106 _ , err = fmt .Fprintf (conn , "%s\r \n " , text )
107107 for err != nil {
108108
109- stdlog .Printf ("[imap.InternalSend] Sending to node '%s' failed, trying to recover...\n " , conn .RemoteAddr ())
109+ stdlog .Printf ("[imap.InternalSend] Sending to node '%s' failed, trying to recover..." , conn .RemoteAddr ())
110110
111111 // Define what IP and port of remote node look like.
112112 remoteAddr := conn .RemoteAddr ().String ()
@@ -119,7 +119,7 @@ func (c *Connection) InternalSend(inc bool, text string) error {
119119 // Reestablish TLS connection to remote node.
120120 conn , err = comm .ReliableConnect (remoteAddr , c .IntlTLSConfig , c .IntlConnRetry )
121121 if err != nil {
122- return fmt .Errorf ("failed to reestablish connection with '%s': %s " , remoteAddr , err . Error () )
122+ return fmt .Errorf ("failed to reestablish connection with '%s': %v " , remoteAddr , err )
123123 }
124124
125125 // Save context to connection.
@@ -133,16 +133,16 @@ func (c *Connection) InternalSend(inc bool, text string) error {
133133 // Inform remote node about which session was active.
134134 err = c .SignalSessionStart (false )
135135 if err != nil {
136- return fmt .Errorf ("signalling session to remote node failed with: %s " , err . Error () )
136+ return fmt .Errorf ("signalling session to remote node failed with: %v " , err )
137137 }
138138 }
139139
140- stdlog .Printf ("[imap.InternalSend] Reconnected to '%s'.\n " , remoteAddr )
140+ stdlog .Printf ("[imap.InternalSend] Reconnected to '%s'." , remoteAddr )
141141
142142 // Resend message to remote node.
143143 _ , err = fmt .Fprintf (conn , "%s\r \n " , text )
144144 } else {
145- return fmt .Errorf ("failed to send message to remote node '%s': %s " , remoteAddr , err . Error () )
145+ return fmt .Errorf ("failed to send message to remote node '%s': %v " , remoteAddr , err )
146146 }
147147 }
148148
@@ -177,7 +177,7 @@ func (c *Connection) Receive(inc bool) (string, error) {
177177 if err != nil {
178178
179179 if err .Error () == "EOF" {
180- stdlog .Printf ("[imap.Receive] Node at '%s' disconnected.\n " , conn .RemoteAddr ().String ())
180+ stdlog .Printf ("[imap.Receive] Node at '%s' disconnected." , conn .RemoteAddr ().String ())
181181 }
182182
183183 break
@@ -320,7 +320,7 @@ func (c *Connection) Terminate() error {
320320func (c * Connection ) Error (msg string , err error ) {
321321
322322 // Log error.
323- stdlog .Printf ("%s: %s . Terminating connection to %s.\n " , msg , err . Error () , c .IncConn .RemoteAddr ().String ())
323+ stdlog .Printf ("%s: %v . Terminating connection to %s." , msg , err , c .IncConn .RemoteAddr ().String ())
324324
325325 // Terminate connection.
326326 err = c .Terminate ()
0 commit comments