// CheckAddresses returns the uri scheme if the address is valid.
CheckAddresses returns the uri scheme if the address is valid.
// CheckAddresses returns the uri scheme if the address is valid .
func CheckAddresses(uriList []string, schemes []string) (scheme string) {
	count := len(uriList)
	if count < 1 {
		panic(errURIListEmpty)
	}
	u, err := url.Parse(uriList[0])
	if err != nil {
		panic(err)
	}
	scheme = u.Scheme
	if sort.SearchStrings(schemes, scheme) == len(schemes) {
		panic(errors.New("This client desn't support " + scheme + " scheme."))
	}
	for i := 1; i < count; i++ {
		u, err := url.Parse(uriList[i])
		if err != nil {
			panic(err)
		}
		if scheme != u.Scheme {
			panic(errNotSupportMultpleProtocol)
		}
	}
	return
}
func CheckAddresses ( uriList [ ] string , schemes [ ] string ) ( scheme string ) { count := len ( uriList ) if count < 1 { panic ( errURIListEmpty ) } u , err := url . Parse ( uriList [ 0 ] ) if err != nil { panic ( err ) } scheme = u . Scheme if sort . SearchStrings ( schemes , scheme ) == len ( schemes ) { panic ( errors . New ( " " + scheme + " " ) ) } for i := 1 ; i < count ; i ++ { u , err := url . Parse ( uriList [ i ] ) if err != nil { panic ( err ) } if scheme != u . Scheme { panic ( errNotSupportMultpleProtocol ) } } return }
CheckAddresses returns the uri scheme if the address is valid.
CheckAddresses returns the uri scheme if the address is valid .