diff --git a/agent.go b/agent.go index fa688b4..0ad6ff2 100644 --- a/agent.go +++ b/agent.go @@ -435,6 +435,7 @@ func (a *Agent) connectivityChecks() { a.updateConnectionState(ConnectionStateFailed) return } + default: } a.selector.ContactCandidates() diff --git a/agent_test.go b/agent_test.go index e6e07c4..ba24f53 100644 --- a/agent_test.go +++ b/agent_test.go @@ -582,6 +582,7 @@ func TestConnectionStateCallback(t *testing.T) { close(isFailed) case ConnectionStateClosed: close(isClosed) + default: } }) if err != nil { @@ -1161,9 +1162,9 @@ func TestConnectionStateConnectingToFailed(t *testing.T) { isFailed.Done() case ConnectionStateChecking: isChecking.Done() - case ConnectionStateConnected: case ConnectionStateCompleted: t.Errorf("Unexpected ConnectionState: %v", c) + default: } } @@ -1357,6 +1358,7 @@ func TestCloseInConnectionStateCallback(t *testing.T) { assert.NoError(t, aAgent.Close()) case ConnectionStateClosed: close(isClosed) + default: } }) if err != nil { @@ -1513,6 +1515,7 @@ func TestLiteLifecycle(t *testing.T) { close(bDisconnected) case ConnectionStateFailed: close(bFailed) + default: } })) diff --git a/ice.go b/ice.go index 441420b..bd55120 100644 --- a/ice.go +++ b/ice.go @@ -9,7 +9,7 @@ type ConnectionState int // List of supported States const ( // ConnectionStateUnknown represents an unknown state - ConnectionStateUnknown = iota + ConnectionStateUnknown ConnectionState = iota // ConnectionStateNew ICE agent is gathering addresses ConnectionStateNew