lints/lint_ext_tor_service_descriptor_hash_invalid.go
func lintOnionURL(onion string) *LintResult {
	if onionURL, err := url.Parse(onion); err != nil {
		return failResult(
			"%s contained "+
				"TorServiceDescriptorHash object with invalid Onion URI",
			torServiceDescExtName)
	} else if onionURL.Host == "" {
		return failResult(
			"%s contained "+
				"TorServiceDescriptorHash object with Onion URI missing a hostname",
			torServiceDescExtName)
	} else if onionURL.Scheme != "https" {
		return failResult(
			"%s contained "+
				"TorServiceDescriptorHash object with Onion URI using a non-HTTPS "+
				"protocol scheme",
			torServiceDescExtName)
	}
	return nil
}
func lintOnionURL(onion string) *LintResult {
	if onionURL, err := url.Parse(onion); err != nil {
		return failResult(
			"%s contained "+
				"TorServiceDescriptorHash object with invalid Onion URI",
			torServiceDescExtName)
	} else if onionURL.Host == "" {
		return failResult(
			"%s contained "+
				"TorServiceDescriptorHash object with Onion URI missing a hostname",
			torServiceDescExtName)
	} else if onionURL.Scheme != "https" {
		return failResult(
			"%s contained "+
				"TorServiceDescriptorHash object with Onion URI using a non-HTTPS "+
				"protocol scheme",
			torServiceDescExtName)
	}
	return nil
}
func lintOnionURL ( onion string ) * LintResult { if onionURL , err := url . Parse ( onion ) ; err != nil { return failResult ( " " + " " , torServiceDescExtName ) } else if onionURL . Host == " " { return failResult ( " " + " " , torServiceDescExtName ) } else if onionURL . Scheme != " " { return failResult ( " " + " " + " " , torServiceDescExtName ) } return nil }
// lintOnionURL verifies that an Onion URI value from a TorServiceDescriptorHash
// is:
//
// 1) a valid parseable url.
// 2) a URL with a non-empty hostname
// 3) a URL with an https:// protocol scheme
//
// If all of the above hold then nil is returned. If any of the above conditions
// are not met an error lint result pointer is returned.
lintOnionURL verifies that an Onion URI value from a TorServiceDescriptorHash is : 1 ) a valid parseable url . 2 ) a URL with a non - empty hostname 3 ) a URL with an https : // protocol scheme If all of the above hold then nil is returned . If any of the above conditions are not met an error lint result pointer is returned .