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: gocloud_object.go
    path of file: ./repos/gitlabhq/workhorse/internal/upload/destination/objectstore
    
    the code of the file until where you have to start completion: package objectstore

import (
	"context"
	"io"
	"time"

	"gitlab.com/gitlab-org/labkit/log"
	"gocloud.dev/blob"
	"gocloud.dev/gcerrors"
)

type GoCloudObject struct {
	bucket     *blob.Bucket
	mux        *blob.URLMux
	bucketURL  string
	objectName string
	*uploader
}

type GoCloudObjectParams struct {
	Ctx        context.Context
	Mux        *blob.URLMux
	BucketURL  string
	ObjectName string
}

func NewGoCloudObject(p *GoCloudObjectParams) (*GoCloudObject, error) {
	buck
    
func (o *GoCloudObject) Upload(ctx context.Context, r io.Reader) error {
	defer o.bucket.Close()

	writerOptions := &blob.WriterOptions{
		BufferSize: ChunkSize,
	}
	writer, err := o.bucket.NewWriter(ctx, o.objectName, writerOptions)
	if err != nil {
		log.ContextLogger(ctx).WithError(err).Error("error creating GoCloud bucket")
		return err
	}

	if _, err = io.Copy(writer, r); err != nil {
		log.ContextLogger(ctx).WithError(err).Error("error writing to GoCloud bucket")
		writer.Close()
		return err
	}

	if err := writer.Close(); err != nil {
		log.ContextLogger(ctx).WithError(err).Error("error closing GoCloud bucket")
		return err
	}

	return nil
}