Skip to content

Commit e19460f

Browse files
authored
fix lint errors (#172)
1 parent e838b20 commit e19460f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

subscription.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,14 +1165,15 @@ func (sc *SubscriptionClient) RunWithContext(ctx context.Context) error {
11651165
for {
11661166
select {
11671167
case <-ctx.Done():
1168+
err = sc.close(subContext)
11681169
// Check if the cancellation came from the parent context
11691170
if errors.Is(ctx.Err(), context.Canceled) {
11701171
// Parent context was canceled, close gracefully without error
1171-
_ = sc.close(subContext)
11721172
return nil
11731173
}
1174+
11741175
// Internal cancellation, return error
1175-
return sc.close(subContext)
1176+
return err
11761177
case e := <-sc.errorChan:
11771178
if sc.getClientStatus() == scStatusClosing {
11781179
return nil

0 commit comments

Comments
 (0)