All Products
Search
Document Center

Object Storage Service:Copy objects using OSS SDK for Go 2.0

Last Updated:Jun 08, 2026

OSS SDK for Go 2.0 provides APIs to copy objects, from single-object copies to resumable multipart operations.

Type

API

Description

Copy an object (OSS SDK for Go 2.0)

Client.CopyObject

  • Copies objects smaller than 5 GiB.

Multipart copy (OSS SDK for Go 2.0)

Multipart copy APIs:

Client.InitiateMultipartUpload

Client.UploadPartCopy

Client.CompleteMultipartUpload

  • Copies objects larger than 5 GiB.

  • Does not support the (x-oss-metadata-directive) or (x-oss-tagging-directive) parameters. Metadata and tags are not automatically copied from the source object. Specify them explicitly in the copy request.

Copier (OSS SDK for Go 2.0)

Copier API:

Copier.Copy

  • Automatically selects the appropriate copy API based on request parameters, abstracting away implementation differences between underlying APIs.