code: func validateResourceName(s string) error {
  	if l := len(s); l < 3 || l > 255 {
  		return fmt.Errorf("length (%d) must be between 3 and 255", l)
  	}
  
  	if strings.HasPrefix(s, "goog") {
  		return errors.New("resource cannot begin with 'goog'")
  	}
  
  	// Validate correctness.
  	for i, r := range s {
  		if r >= unicode.MaxASCII {
  			return fmt.Errorf("non-ASCII character found at index #%d", i)
  		}
  
  		if !((r >= 'a' && r <= 'z') || (r >= 'A' && r <= 'Z')) {
  			// Must begin with an ASCII letter?
  			if i == 0 {
  				return errors.New("pubsub: resource names must begin with a letter")
  			}
  
  			// Is this a valid mid-resource value?
  			const validMidResourceRunes = "-_.~+%"
  			if !((r >= '0' && r <= '9') || strings.ContainsRune(validMidResourceRunes, r)) {
  				return fmt.Errorf("pubsub: invalid resource rune at %d: %c", i, r)
  			}
  		}
  	}
  	return nil
  }
docs: // validateResourceName validates a resource name. Resource naming is described
  // in: https://cloud.google.com/pubsub/overview#names
  //
  // As of 'v1', a resource must:
  // - start with a letter.
  // - end with a lowercase letter or number.
  // - contain only letters, numbers, dashes (-), underscores (_) periods (.),
  //   tildes (~), pluses (+), or percent signs (%).
  // - be between 3 and 255 characters in length.
  // - cannot begin with the string goog.
  //