Skip to content

Commit

Permalink
resolver: Remove redundant port range check
Browse files Browse the repository at this point in the history
  • Loading branch information
tsenart committed Aug 30, 2018
1 parent 44272a8 commit 1441023
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions internal/resolver/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,11 @@ func normalizeAddrs(addrs []string) ([]string, error) {
}

// validate valid port.
port, err := strconv.ParseUint(portstr, 10, 16)
_, err = strconv.ParseUint(portstr, 10, 16)
if err != nil {
return nil, err
}

if port <= 0 {
return nil, errors.New("invalid port")
}

// make sure host is an ip.
ip := net.ParseIP(host)
if ip == nil {
Expand Down

0 comments on commit 1441023

Please sign in to comment.