Print iplist.Range nicely

This commit is contained in:
Matt Joiner 2014-11-29 20:30:04 -06:00
parent a1d81abb0d
commit d39caca48e
1 changed files with 4 additions and 0 deletions

View File

@ -18,6 +18,10 @@ type Range struct {
Description string
}
func (r *Range) String() string {
return fmt.Sprintf("%s-%s (%s)", r.First, r.Last, r.Description)
}
// Create a new IP list. The given range must already sorted by the lower IP
// in the range. Behaviour is undefined for lists of overlapping ranges.
func New(initSorted []Range) *IPList {