code: func validateURL(ctx *validation.Context, s string) (*url.URL, bool) {
  	// url.Parse considers "example.com/a/b" to be a path, so ensure a scheme.
  	if !strings.HasPrefix(s, "https://") {
  		s = "https://" + s
  	}
  	u, err := url.Parse(s)
  	if err != nil {
  		ctx.Error(errors.Annotate(err, "not a valid URL").Err())
  		return nil, false
  	}
  	valid := true
  	if !strings.HasSuffix(u.Host, ".googlesource.com") {
  		ctx.Errorf("isn't at *.googlesource.com %q", u.Host)
  		valid = false
  	}
  	if u.Scheme != "" && u.Scheme != "https" {
  		ctx.Errorf("scheme must be https")
  		valid = false
  	}
  	if strings.HasSuffix(u.Host, "-review.googlesource.com") {
  		ctx.Errorf("must not be a Gerrit host (try without '-review')")
  		valid = false
  	}
  	return u, valid
  }
docs: // validateURL returns parsed URL and whether it has passed validation.