Skip to content

Commit

Permalink
Fix linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ernado committed May 20, 2019
1 parent 333db01 commit 9084442
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ issues:
exclude-use-default: false
max-per-linter: 0
max-same-issues: 50

exclude-rules:
- path: _test\.go
linters:
- dupl
2 changes: 1 addition & 1 deletion candidate.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func (c *Candidate) recvLoop() {
}
// Explicitly copy raw buffer so Message can own the memory.
copy(m.Raw, buffer[:n])
if err := m.Decode(); err != nil {
if err = m.Decode(); err != nil {
log.Warnf("Failed to handle decode ICE from %s to %s: %v", c.addr(), srcAddr, err)
continue
}
Expand Down
4 changes: 2 additions & 2 deletions url.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ func ParseURL(raw string) (*URL, error) {
switch {
case u.Scheme == SchemeTypeSTUN:
qArgs, err := url.ParseQuery(rawParts.RawQuery)
if err != nil || (err == nil && len(qArgs) > 0) {
if err != nil || len(qArgs) > 0 {
return nil, ErrSTUNQuery
}
u.Proto = ProtoTypeUDP
case u.Scheme == SchemeTypeSTUNS:
qArgs, err := url.ParseQuery(rawParts.RawQuery)
if err != nil || (err == nil && len(qArgs) > 0) {
if err != nil || len(qArgs) > 0 {
return nil, ErrSTUNQuery
}
u.Proto = ProtoTypeTCP
Expand Down

0 comments on commit 9084442

Please sign in to comment.