// canonicalizeIP ensures that the given IP is in standard form
// and returns an error otherwise.
canonicalizeIP ensures that the given IP is in standard form
and returns an error otherwise.
// canonicalizeIP ensures that the given IP is in standard form // and returns an error otherwise .
func canonicalizeIP(ip *net.IP) error {
	if ip.To4() != nil {
		*ip = ip.To4()
		return nil
	}
	if ip.To16() != nil {
		*ip = ip.To16()
		return nil
	}
	return fmt.Errorf("IP %q is of unknown type", ip)
}
func canonicalizeIP ( ip * net . IP ) error { if ip . To4 ( ) != nil { * ip = ip . To4 ( ) return nil } if ip . To16 ( ) != nil { * ip = ip . To16 ( ) return nil } return fmt . Errorf ( " " , ip ) }
canonicalizeIP ensures that the given IP is in standard form
and returns an error otherwise.
canonicalizeIP ensures that the given IP is in standard form and returns an error otherwise .