Help Center/ Object Storage Service/ SDK Reference/ Go/ Downloading and Installing OBS SDK for Go
Updated on 2024-06-21 GMT+08:00

Downloading and Installing OBS SDK for Go

This topic provides the download links and installation methods of OBS SDK for Go.

Installing OBS SDK for Go

You can use the methods listed in Table 1 to install OBS SDK for Go.

Table 1 Methods of installing OBS SDK for Go

No.

Method

1

Download an installation package and use GoLand to create a go project.

2

Run the go get command.

Method 1: Downloading an Installation Package and Creating a Go Project

This procedure uses the latest version as an example:

  1. Download the SDK package.
  2. Decompress the package to obtain the following files: obs (the SDK source code), main, examples (the sample code), and README.MD (the feature description file of SDK versions).
  3. Use GoLand to create a Go project and copy the obs, examples, and main folders to the src folder of your Go project.
  4. Right-click the Go project and choose Build Project from the drop-down list, and wait until the building is complete.

    After the building is complete, you can get a directory structure similar to the following:

    ├── bin

    ├── pkg

    ├── src

    -----├── examples

    -----├── main

    -----└── obs

    └── README.MD

Method 2: Running the go get Command

1
go get github.com/huaweicloud/huaweicloud-sdk-go-obs/obs