code: func ValidatePackageRef(r string) error {
  	if ValidateInstanceID(r, AnyHash) == nil {
  		return fmt.Errorf("invalid ref name (looks like an instance ID): %q", r)
  	}
  	if !packageRefRe.MatchString(r) {
  		return fmt.Errorf("invalid ref name: %q", r)
  	}
  	return nil
  }
docs: // ValidatePackageRef returns error if a string doesn't look like a valid ref.