package
Version:
v0.0.0-...-d8be82f
Opens a new window with list of versions in this module.
Published: Jan 19, 2024
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Sort sorts a slice of intervals by start (and then end, for equal
starts).
I represents an (inclusive) interval.
func New(start, end int) I
New creates a new Interval, given start and end.
func (i I) Adjacent(other I) bool
Adjacent checks if this interval is right next to the other.
func (i I) Contains(other I) bool
Contains checks if this interval completely contains the other.
func (i I) Merge(other I) I
Merge takes two intervals, and returns one new one that stretches
from the lowest number in either to the highest number in either.
func (i I) Overlaps(other I) bool
Overlap checks if this interval overlaps with the other.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.