This topic describes how to install EventBridge SDK for Go.

Prepare the environment

  • Prerequisites

    Go 1.12.0 or later is installed. For more information, see Install Go.

  • Check the Go version

    Run the go version command to view the version of Go.

Install the SDK

  1. Run the following command to enable Go mod:
    go env -w GO111MODULE=on
  2. Run the following command to set a Go mod proxy:
    go env -w GOPROXY=https://goproxy.cn,direct 
  3. Run the following command to initialize Go mode and generate the go.mod file:
    go mod init
  4. Run the following command to install SDK for Go:
    go get github.com/alibabacloud-go/eventbridge-sdk    
  5. Run the following command to install the output library for Go:
    go get github.com/alibabacloud/tea-console