-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathipx.go
38 lines (31 loc) · 779 Bytes
/
ipx.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package ipx
// AddrError declares the address error
type AddrError struct {
Err string
Addr string
}
// Error throws the error
func (e *AddrError) Error() string {
if e == nil {
return "<nil>"
}
s := e.Err
if e.Addr != "" {
s = "address " + e.Addr + ": " + s
}
return s
}
// A ParseError is the error type of literal network address parsers.
type ParseError struct {
// Type is the type of string that was expected, such as
// "IP address", "CIDR address".
Type string
// Text is the malformed text string.
Text string
}
// Error ..
func (e *ParseError) Error() string { return "invalid " + e.Type + ": " + e.Text }
// Timeout ..
func (e *ParseError) Timeout() bool { return false }
// Temporary ..
func (e *ParseError) Temporary() bool { return false }