]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Fix iplist.Range.String, and a comment
authorMatt Joiner <anacrolix@gmail.com>
Sun, 22 Jul 2018 02:59:02 +0000 (12:59 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Sun, 22 Jul 2018 02:59:02 +0000 (12:59 +1000)
iplist/iplist.go

index 7c29f0077c42555d03aff88b15a337b0e4b9392b..d6d70a96256653224e9227f1fbfe6684a7bab28d 100644 (file)
@@ -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
@@ -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