@@ -311,7 +311,7 @@ func (disc *PluggableDiscovery) Run() (err error) {
311
311
if msg , err := disc .waitMessage (time .Second * 10 ); err != nil {
312
312
return fmt .Errorf (tr ("calling %[1]s: %[2]w" ), "HELLO" , err )
313
313
} 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 )
315
315
} else if strings .ToUpper (msg .Message ) != "OK" || msg .Error {
316
316
return errors .Errorf (tr ("command failed: %s" ), msg .Message )
317
317
} else if msg .ProtocolVersion > 1 {
@@ -332,7 +332,7 @@ func (disc *PluggableDiscovery) Start() error {
332
332
if msg , err := disc .waitMessage (time .Second * 10 ); err != nil {
333
333
return fmt .Errorf (tr ("calling %[1]s: %[2]w" ), "START" , err )
334
334
} 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 )
336
336
} else if strings .ToUpper (msg .Message ) != "OK" || msg .Error {
337
337
return errors .Errorf (tr ("command failed: %s" ), msg .Message )
338
338
}
@@ -352,7 +352,7 @@ func (disc *PluggableDiscovery) Stop() error {
352
352
if msg , err := disc .waitMessage (time .Second * 10 ); err != nil {
353
353
return fmt .Errorf (tr ("calling %[1]s: %[2]w" ), "STOP" , err )
354
354
} 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 )
356
356
} else if strings .ToUpper (msg .Message ) != "OK" || msg .Error {
357
357
return errors .Errorf (tr ("command failed: %s" ), msg .Message )
358
358
}
@@ -375,7 +375,7 @@ func (disc *PluggableDiscovery) Quit() error {
375
375
if msg , err := disc .waitMessage (time .Second * 10 ); err != nil {
376
376
return fmt .Errorf (tr ("calling %[1]s: %[2]w" ), "QUIT" , err )
377
377
} 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 )
379
379
} else if strings .ToUpper (msg .Message ) != "OK" || msg .Error {
380
380
return errors .Errorf (tr ("command failed: %s" ), msg .Message )
381
381
}
@@ -392,7 +392,7 @@ func (disc *PluggableDiscovery) List() ([]*Port, error) {
392
392
if msg , err := disc .waitMessage (time .Second * 10 ); err != nil {
393
393
return nil , fmt .Errorf (tr ("calling %[1]s: %[2]w" ), "LIST" , err )
394
394
} 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 )
396
396
} else if msg .Error {
397
397
return nil , errors .Errorf (tr ("command failed: %s" ), msg .Message )
398
398
} else {
@@ -415,7 +415,7 @@ func (disc *PluggableDiscovery) StartSync(size int) (<-chan *Event, error) {
415
415
if msg , err := disc .waitMessage (time .Second * 10 ); err != nil {
416
416
return nil , fmt .Errorf (tr ("calling %[1]s: %[2]w" ), "START_SYNC" , err )
417
417
} 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 )
419
419
} else if strings .ToUpper (msg .Message ) != "OK" || msg .Error {
420
420
return nil , errors .Errorf (tr ("command failed: %s" ), msg .Message )
421
421
}
0 commit comments