mirror of
https://github.com/pion/ice.git
synced 2025-11-01 19:22:34 +08:00
Update CI configs to v0.4.7
Update lint scripts and CI configs.
This commit is contained in:
6
stun.go
6
stun.go
@@ -1,22 +1,18 @@
|
||||
package ice
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
|
||||
"github.com/pion/stun"
|
||||
)
|
||||
|
||||
// bin is shorthand for BigEndian.
|
||||
var bin = binary.BigEndian
|
||||
|
||||
func assertInboundUsername(m *stun.Message, expectedUsername string) error {
|
||||
var username stun.Username
|
||||
if err := username.GetFrom(m); err != nil {
|
||||
return err
|
||||
}
|
||||
if string(username) != expectedUsername {
|
||||
return fmt.Errorf("username mismatch expected(%x) actual(%x)", expectedUsername, string(username))
|
||||
return fmt.Errorf("%w expected(%x) actual(%x)", errMismatchUsername, expectedUsername, string(username))
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user