code: func credentials(url string) string {
  	index := strings.IndexRune(url, '@')
  	if index == -1 {
  		return ""
  	}
  	if protocol := Protocol(url); protocol != "" {
  		return url[len(protocol)+3 : index]
  	}
  	return url[:index]
  }
docs: // credentials returns credentials (user:pass) from given url