This topic describes how to prepare the environment before you use the SDK for Go to send and receive messages.
Procedure
Download the Go client. For more information, see the SDK source code repository.
Obtain the resources.
You must create the resources, including the instance endpoint, topic, and consumer group, that are used in the code of the SDK in the ApsaraMQ for RocketMQ console in advance. For more information, see Step 2: Create resources.
Run the following command to install the SDK for Go:
go get -u github.com/apache/rocketmq-clients/golang/v5
Modify the parameters in the sample code based on the resource information obtained in Step 2: Create resources. Then, run the sample code.