Skip to content

Commit c2756c1

Browse files
committed
Change type of ConnectionState constants
1 parent ca9de18 commit c2756c1

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

agent.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ func (a *Agent) connectivityChecks() {
435435
a.updateConnectionState(ConnectionStateFailed)
436436
return
437437
}
438+
default:
438439
}
439440

440441
a.selector.ContactCandidates()

agent_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ func TestConnectionStateCallback(t *testing.T) {
582582
close(isFailed)
583583
case ConnectionStateClosed:
584584
close(isClosed)
585+
default:
585586
}
586587
})
587588
if err != nil {
@@ -1161,9 +1162,9 @@ func TestConnectionStateConnectingToFailed(t *testing.T) {
11611162
isFailed.Done()
11621163
case ConnectionStateChecking:
11631164
isChecking.Done()
1164-
case ConnectionStateConnected:
11651165
case ConnectionStateCompleted:
11661166
t.Errorf("Unexpected ConnectionState: %v", c)
1167+
default:
11671168
}
11681169
}
11691170

@@ -1357,6 +1358,7 @@ func TestCloseInConnectionStateCallback(t *testing.T) {
13571358
assert.NoError(t, aAgent.Close())
13581359
case ConnectionStateClosed:
13591360
close(isClosed)
1361+
default:
13601362
}
13611363
})
13621364
if err != nil {
@@ -1513,6 +1515,7 @@ func TestLiteLifecycle(t *testing.T) {
15131515
close(bDisconnected)
15141516
case ConnectionStateFailed:
15151517
close(bFailed)
1518+
default:
15161519
}
15171520
}))
15181521

ice.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type ConnectionState int
99
// List of supported States
1010
const (
1111
// ConnectionStateUnknown represents an unknown state
12-
ConnectionStateUnknown = iota
12+
ConnectionStateUnknown ConnectionState = iota
1313

1414
// ConnectionStateNew ICE agent is gathering addresses
1515
ConnectionStateNew

0 commit comments

Comments
 (0)