-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.go
More file actions
23 lines (18 loc) · 749 Bytes
/
errors.go
File metadata and controls
23 lines (18 loc) · 749 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package iprange
import "errors"
var (
// The string is not a valid IP range format. It occurs when parsing an
// invalid IP range string.
errInvalidIPRangeFormat = errors.New("invalid IP range format")
// Dual-stack IP ranges are not allowed. It occurs when parsing a set of
// IP range strings, where there are both IPv4 and IPv6 addresses.
errDualStackIPRanges = errors.New("dual-stack IP ranges")
)
// IsInvalidIPRangeFormat asserts whether the err is errInvalidIPRangeFormat.
func IsInvalidIPRangeFormat(err error) bool {
return errors.Is(err, errInvalidIPRangeFormat)
}
// IsDualStackIPRanges asserts whether the err is errDualStackIPRanges.
func IsDualStackIPRanges(err error) bool {
return errors.Is(err, errDualStackIPRanges)
}