Skip to content

Commit

Permalink
Fix panic lint
Browse files Browse the repository at this point in the history
Fix panic lint
  • Loading branch information
cnderrauber committed Sep 1, 2023
1 parent 0a385a4 commit 9ca1867
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions udp_mux_multi.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ import (
tudp "github.com/pion/transport/v2/udp"
)

var (
errPortBalanceRequireConnCount = errors.New("Port balance requires UDPMux implements MuxConnCount interface")
)
var errPortBalanceRequireConnCount = errors.New("Port balance requires UDPMux implements MuxConnCount interface")

// MultiUDPMuxDefault implements both UDPMux and AllConnsGetter,
// allowing users to pass multiple UDPMux instances to the ICE agent
Expand Down Expand Up @@ -74,7 +72,11 @@ type multipleUDPMuxDefaultParams struct {
// uses the provided UDPMux instances.
func NewMultiUDPMuxDefault(muxes ...UDPMux) *MultiUDPMuxDefault {
mux, err := NewMultiUDPMuxDefaultWithOptions(muxes)

// The error should always be nil as no options given to NewMultiUDPMuxDefaultWithOptions that it
// only return error when port balance enabled but mux don't support MuxConnCount.
if err != nil {
//nolint:forbidigo
panic(err)
}
return mux
Expand Down

0 comments on commit 9ca1867

Please sign in to comment.