func parseBucketResource(a arn.ARN, resParts []string) (bucketName string, err error) {
	if len(resParts) == 0 {
		return bucketName, InvalidARNError{ARN: a, Reason: "bucket resource-id not set"}
	}
	if len(resParts) > 1 {
		return bucketName, InvalidARNError{ARN: a, Reason: "sub resource not supported"}
	}

	bucketName = strings.TrimSpace(resParts[0])
	if len(bucketName) == 0 {
		return bucketName, InvalidARNError{ARN: a, Reason: "bucket resource-id not set"}
	}
	return bucketName, err
}
// parseBucketResource attempts to parse the ARN's bucket resource and retrieve the
// bucket resource id.
//
// parseBucketResource only parses the bucket resource id.
//
parseBucketResource attempts to parse the ARN's bucket resource and retrieve the
bucket resource id.

parseBucketResource only parses the bucket resource id.
// parseBucketResource attempts to parse the ARN ' s bucket resource and retrieve the // bucket resource id . // // parseBucketResource only parses the bucket resource id . //
func parseBucketResource(a arn.ARN, resParts []string) (bucketName string, err error) {
	if len(resParts) == 0 {
		return bucketName, InvalidARNError{ARN: a, Reason: "bucket resource-id not set"}
	}
	if len(resParts) > 1 {
		return bucketName, InvalidARNError{ARN: a, Reason: "sub resource not supported"}
	}
	bucketName = strings.TrimSpace(resParts[0])
	if len(bucketName) == 0 {
		return bucketName, InvalidARNError{ARN: a, Reason: "bucket resource-id not set"}
	}
	return bucketName, err
}
func parseBucketResource ( a arn . ARN , resParts [ ] string ) ( bucketName string , err error ) { if len ( resParts ) == 0 { return bucketName , InvalidARNError { ARN : a , Reason : " " } } if len ( resParts ) > 1 { return bucketName , InvalidARNError { ARN : a , Reason : " " } } bucketName = strings . TrimSpace ( resParts [ 0 ] ) if len ( bucketName ) == 0 { return bucketName , InvalidARNError { ARN : a , Reason : " " } } return bucketName , err }
parseBucketResource attempts to parse the ARN's bucket resource and retrieve the
bucket resource id.
parseBucketResource attempts to parse the ARN ' s bucket resource and retrieve the bucket resource id .