You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: upload.go
    path of file: ./repos/aws-sdk-go-v2/feature/s3/manager
    
    the code of the file until where you have to start completion: package manager

import (
	"bytes"
	"context"
	"fmt"
	"io"
	"net/http"
	"sort"
	"sync"

	"github.com/aws/aws-sdk-go-v2/aws"

	"github.com/aws/aws-sdk-go-v2/aws/middleware"
	"github.com/aws/aws-sdk-go-v2/internal/awsutil"
	internalcontext "github.com/aws/aws-sdk-go-v2/internal/context"
	"github.com/aws/aws-sdk-go-v2/service/s3"
	"github.com/aws/aws-sdk-go-v2/service/s3/types"
	smithymiddleware "github.com/aws/smithy-go/mid
    
func (u *uploader) singlePart(r io.ReadSeeker, cleanup func()) (*UploadOutput, error) {
	defer cleanup()

	var params s3.PutObjectInput
	awsutil.Copy(&params, u.in)
	params.Body = r

	// Need to use request form because URL generated in request is
	// used in return.

	var locationRecorder recordLocationClient
	out, err := u.cfg.S3.PutObject(u.ctx, &params,
		append(u.cfg.ClientOptions, locationRecorder.WrapClient())...)
	if err != nil {
		return nil, err
	}

	return &UploadOutput{
		Location: locationRecorder.location,

		BucketKeyEnabled:     aws.ToBool(out.BucketKeyEnabled),
		ChecksumCRC32:        out.ChecksumCRC32,
		ChecksumCRC32C:       out.ChecksumCRC32C,
		ChecksumSHA1:         out.ChecksumSHA1,
		ChecksumSHA256:       out.ChecksumSHA256,
		ETag:                 out.ETag,
		Expiration:           out.Expiration,
		Key:                  params.Key,
		RequestCharged:       out.RequestCharged,
		SSEKMSKeyId:          out.SSEKMSKeyId,
		ServerSideEncryption: out.ServerSideEncryption,
		VersionID:            out.VersionId,
	}, nil
}