mirror of
https://gitlab.com/pnx-tools/dns-updater.git
synced 2026-06-16 05:54:56 +02:00
15 lines
217 B
Go
15 lines
217 B
Go
package internal
|
|
|
|
import "net"
|
|
|
|
func ParseIP(s string) (net.IP, error) {
|
|
var err error = nil
|
|
ip := net.ParseIP(s)
|
|
if ip == nil {
|
|
err = &net.ParseError{
|
|
Type: "IP address",
|
|
Text: s,
|
|
}
|
|
}
|
|
return ip, err
|
|
}
|