// multiscan scans all DNS addresses returned for the host, returning the lowest grade
// and the concatenation of all the output.
multiscan scans all DNS addresses returned for the host, returning the lowest grade
and the concatenation of all the output.
// multiscan scans all DNS addresses returned for the host returning the lowest grade // and the concatenation of all the output .
func multiscan(host string, scan func(string) (Grade, Output, error)) (grade Grade, output Output, err error) {
	domain, port, _ := net.SplitHostPort(host)
	var addrs []string
	addrs, err = net.LookupHost(domain)
	if err != nil {
		return
	}
	grade = Good
	out := make(map[string]Output)
	for _, addr := range addrs {
		var g Grade
		var o Output
		g, o, err = scan(net.JoinHostPort(addr, port))
		if err != nil {
			grade = Bad
			return
		}
		if g < grade {
			grade = g
		}
		out[addr] = o
	}
	output = out
	return
}
func multiscan ( host string , scan func ( string ) ( Grade , Output , error ) ) ( grade Grade , output Output , err error ) { domain , port , _ := net . SplitHostPort ( host ) var addrs [ ] string addrs , err = net . LookupHost ( domain ) if err != nil { return } grade = Good out := make ( map [ string ] Output ) for _ , addr := range addrs { var g Grade var o Output g , o , err = scan ( net . JoinHostPort ( addr , port ) ) if err != nil { grade = Bad return } if g < grade { grade = g } out [ addr ] = o } output = out return }
multiscan scans all DNS addresses returned for the host, returning the lowest grade
and the concatenation of all the output.
multiscan scans all DNS addresses returned for the host returning the lowest grade and the concatenation of all the output .