Skip to main content

Install the Go agent with direct download

To install the Go agent:

  1. Download the executable files from https://pkg.contrastsecurity.com.

    The contrast-go executables can be downloaded directly for Mac and Linux operating systems. You can see available versions in the go-agent-release user interface. Replace <version> with the version number you want, or latest.

    • For Mac:

      wget https://pkg.contrastsecurity.com/go-agent-release/<version>/darwin-amd64/contrast-go

      or

      curl -L https://pkg.contrastsecurity.com/go-agent-release/<version>/darwin-amd64/contrast-go > contrast-go
    • For Linux:

      wget https://pkg.contrastsecurity.com/go-agent-release/<version>/linux-amd64/contrast-go

      or

      curl -L https://pkg.contrastsecurity.com/go-agent-release/<version>/linux-amd64/contrast-go > contrast-go
  2. After download, verify that the agent is executable. For example:

    chmod u+x contrast-go
  3. Be sure the application has a go.mod file to indicate required dependencies. In the application source directory run the following command:

    go mod init
  4. Build your application:

    ./contrast-go build -o output-name-of-application
  5. Configure the Go agent using the Go YAML template or environment variables.

  6. Run your application using the executable from the output above.

  7. Exercise and test your application.

  8. Verify that Contrast sees your application.