forked from Silverfish/proton-bridge
Other(refactor): Remove always-nil return value of (*Bridge).Close
This commit is contained in:
@ -106,10 +106,12 @@ func (t *testCtx) startBridge() error {
|
||||
}
|
||||
|
||||
func (t *testCtx) stopBridge() error {
|
||||
if err := t.bridge.Close(context.Background()); err != nil {
|
||||
return err
|
||||
if t.bridge == nil {
|
||||
return fmt.Errorf("bridge is not running")
|
||||
}
|
||||
|
||||
t.bridge.Close(context.Background())
|
||||
|
||||
t.bridge = nil
|
||||
|
||||
return nil
|
||||
|
||||
@ -261,9 +261,7 @@ func (t *testCtx) close(ctx context.Context) error {
|
||||
}
|
||||
|
||||
if t.bridge != nil {
|
||||
if err := t.bridge.Close(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
t.bridge.Close(ctx)
|
||||
}
|
||||
|
||||
t.api.Close()
|
||||
|
||||
Reference in New Issue
Block a user