code: func endpointIsOfficial(endpoint string) (bool, string, error) {
  	for _, partition := range endpoints.DefaultPartitions() {
  		for _, region := range partition.Regions() {
  			s3Endpoint, err := region.ResolveEndpoint(endpoints.S3ServiceID)
  			if err != nil {
  				// S3 isn't available in this region yet; unlikely to ever happen
  				continue
  			}
  			p, err := url.Parse(s3Endpoint.URL)
  			if err != nil {
  				return false, endpoint, err
  			}
  
  			if strings.HasSuffix(endpoint, p.Host) {
  				return true, p.Host, nil
  			}
  		}
  	}
  	return false, endpoint, nil
  }
docs: // endpointIsOfficial determines if the endpoint is an aws one.
  // If it is an aws one, it will return the aws canonical endpoint as well,
  // otherwise it will return the endpoint unmodified.
  // For example, "s3.amazonaws.com" is the canonical us-east-1 endpoint,
  // 's3.us-west-2.amazonaws.com' is the canonical us-west-2 endpoint, and so on.
  // There are additional official endpoints, such as
  // 's3-us-west-2.amazonaws.com', but these endpoints are not exposed by the
  // SDK's public interfaces, so we can't test against those.
  // For more information on these endpoints, see AWS's list:
  // https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region
  // In any case where a user has one of these endpoints set, it will not be
  // recognized as an AWS endpoint correctly, but should still function just fine
  // since this detection is for the purpose of relaxing some constraints on
  // non-AWS endpoints, so it's perfectly fine to have false negatives.