@@ -311,7 +311,7 @@ func (disc *PluggableDiscovery) Run() (err error) {
311311 if msg , err := disc .waitMessage (time .Second * 10 ); err != nil {
312312 return fmt .Errorf (tr ("calling %[1]s: %[2]w" ), "HELLO" , err )
313313 } else if msg .EventType != "hello" {
314- return errors .Errorf (tr ("communication out of sync, expected 'hello ', received '%s'" ), msg .EventType )
314+ return errors .Errorf (tr ("communication out of sync, expected '%[1]s ', received '%[2] s'" ), "hello" , msg .EventType )
315315 } else if strings .ToUpper (msg .Message ) != "OK" || msg .Error {
316316 return errors .Errorf (tr ("command failed: %s" ), msg .Message )
317317 } else if msg .ProtocolVersion > 1 {
@@ -332,7 +332,7 @@ func (disc *PluggableDiscovery) Start() error {
332332 if msg , err := disc .waitMessage (time .Second * 10 ); err != nil {
333333 return fmt .Errorf (tr ("calling %[1]s: %[2]w" ), "START" , err )
334334 } else if msg .EventType != "start" {
335- return errors .Errorf (tr ("communication out of sync, expected 'start ', received '%s'" ), msg .EventType )
335+ return errors .Errorf (tr ("communication out of sync, expected '%[1]s ', received '%[2] s'" ), "start" , msg .EventType )
336336 } else if strings .ToUpper (msg .Message ) != "OK" || msg .Error {
337337 return errors .Errorf (tr ("command failed: %s" ), msg .Message )
338338 }
@@ -352,7 +352,7 @@ func (disc *PluggableDiscovery) Stop() error {
352352 if msg , err := disc .waitMessage (time .Second * 10 ); err != nil {
353353 return fmt .Errorf (tr ("calling %[1]s: %[2]w" ), "STOP" , err )
354354 } else if msg .EventType != "stop" {
355- return errors .Errorf (tr ("communication out of sync, expected 'stop ', received '%s'" ), msg .EventType )
355+ return errors .Errorf (tr ("communication out of sync, expected '%[1]s ', received '%[2] s'" ), "stop" , msg .EventType )
356356 } else if strings .ToUpper (msg .Message ) != "OK" || msg .Error {
357357 return errors .Errorf (tr ("command failed: %s" ), msg .Message )
358358 }
@@ -375,7 +375,7 @@ func (disc *PluggableDiscovery) Quit() error {
375375 if msg , err := disc .waitMessage (time .Second * 10 ); err != nil {
376376 return fmt .Errorf (tr ("calling %[1]s: %[2]w" ), "QUIT" , err )
377377 } else if msg .EventType != "quit" {
378- return errors .Errorf (tr ("communication out of sync, expected 'quit ', received '%s'" ), msg .EventType )
378+ return errors .Errorf (tr ("communication out of sync, expected '%[1]s ', received '%[2] s'" ), "quit" , msg .EventType )
379379 } else if strings .ToUpper (msg .Message ) != "OK" || msg .Error {
380380 return errors .Errorf (tr ("command failed: %s" ), msg .Message )
381381 }
@@ -392,7 +392,7 @@ func (disc *PluggableDiscovery) List() ([]*Port, error) {
392392 if msg , err := disc .waitMessage (time .Second * 10 ); err != nil {
393393 return nil , fmt .Errorf (tr ("calling %[1]s: %[2]w" ), "LIST" , err )
394394 } else if msg .EventType != "list" {
395- return nil , errors .Errorf (tr ("communication out of sync, expected 'list ', received '%s'" ), msg .EventType )
395+ return nil , errors .Errorf (tr ("communication out of sync, expected '%[1]s ', received '%[2] s'" ), "list" , msg .EventType )
396396 } else if msg .Error {
397397 return nil , errors .Errorf (tr ("command failed: %s" ), msg .Message )
398398 } else {
@@ -415,7 +415,7 @@ func (disc *PluggableDiscovery) StartSync(size int) (<-chan *Event, error) {
415415 if msg , err := disc .waitMessage (time .Second * 10 ); err != nil {
416416 return nil , fmt .Errorf (tr ("calling %[1]s: %[2]w" ), "START_SYNC" , err )
417417 } else if msg .EventType != "start_sync" {
418- return nil , errors .Errorf (tr ("communication out of sync, expected 'start_sync ', received '%s'" ), msg .EventType )
418+ return nil , errors .Errorf (tr ("communication out of sync, expected '%[1]s ', received '%[2] s'" ), "start_sync" , msg .EventType )
419419 } else if strings .ToUpper (msg .Message ) != "OK" || msg .Error {
420420 return nil , errors .Errorf (tr ("command failed: %s" ), msg .Message )
421421 }
0 commit comments