Before you use Content Moderation SDK for Go, you must install the required dependencies.
Prerequisites
Go 1.10.0 or later is used.
Install the SDK
Download Content Moderation SDK for Go.
Run the following command to install Content Moderation SDK for Go:
go get -u github.com/aliyun/alibaba-cloud-sdk-go/sdk
Run the following command to install the required dependencies:
import "github.com/aliyun/alibaba-cloud-sdk-go/services/green"
Configure environment variables
In Alibaba Cloud SDK code, you can create a default access credential by defining ALIBABA_CLOUD_ACCESS_KEY_ID
and ALIBABA_CLOUD_ACCESS_KEY_SECRET
environment variables. When you call API operations of Alibaba Cloud services, the system directly accesses the credential, reads your AccessKey pair, and then automatically completes authentication. Before you use the SDK sample code, you must configure environment variables. For more information, see Configure credentials.