ip.go
func GetPrivateHostIPs() ([]net.IP, error) {
	ips, err := GetHostIPs()
	if err != nil {
		return nil, err
	}

	var privateIPs []net.IP
	for _, ip := range ips {
		// skip loopback, non-IPv4 and non-private addresses
		if ip.IsLoopback() || ip.To4() == nil || !IsPrivate(ip) {
			continue
		}
		privateIPs = append(privateIPs, ip)
	}

	return privateIPs, nil
}
func GetPrivateHostIPs() ([]net.IP, error) {
	ips, err := GetHostIPs()
	if err != nil {
		return nil, err
	}

	var privateIPs []net.IP
	for _, ip := range ips {
		// skip loopback, non-IPv4 and non-private addresses
		if ip.IsLoopback() || ip.To4() == nil || !IsPrivate(ip) {
			continue
		}
		privateIPs = append(privateIPs, ip)
	}

	return privateIPs, nil
}
// GetPrivateHostIPs returns a list of host's private IP addresses.