code: func AttemptSecured(url string, allowInSecure bool) bool {
  	ok, err := regexp.MatchString(".*(?i)s://", url)
  	if ok && err == nil {
  		return true
  	} else if strings.Contains(url, "://") {
  		return false
  	} else {
  		return !allowInSecure
  	}
  }
docs: //AttemptSecured is a utility function which verifies URL and returns if secured connections needs to established
  // for protocol 'grpcs' in URL returns true
  // for protocol 'grpc' in URL returns false
  // for no protocol mentioned, returns !allowInSecure