Skip to content

Commit

Permalink
Fix iplist.Range.String, and a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
anacrolix committed Jul 22, 2018
1 parent 8479f21 commit 3a7152c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions iplist/iplist.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ type Range struct {
Description string
}

func (r *Range) String() string {
return fmt.Sprintf("%s-%s (%s)", r.First, r.Last, r.Description)
func (r Range) String() string {
return fmt.Sprintf("%s-%s: %s", r.First, r.Last, r.Description)
}

// Create a new IP list. The given ranges must already sorted by the lower
Expand All @@ -49,7 +49,7 @@ func (ipl *IPList) NumRanges() int {
return len(ipl.ranges)
}

// Return the range the given IP is in. Returns nil if no range is found.
// Return the range the given IP is in. ok if false if no range is found.
func (ipl *IPList) Lookup(ip net.IP) (r Range, ok bool) {
if ipl == nil {
return
Expand Down

0 comments on commit 3a7152c

Please sign in to comment.