CtrlB
  • CtrlB Flow
    • 🖐️Introducing CtrlB Flow
    • 🏁Getting started
    • Getting data in CtrlB Flow
    • Explore your data
    • Control your data
  • CtrlB Live Debug
    • 🖐️Introducing CtrlB Live Debug
      • What can you do with CtrlB?
      • How CtrlB works?
    • 🏁Getting started in 2 minutes
    • Plugins
      • Visual Studio Code
      • PyCharm, IntelliJ & WebStorm
    • Agents
      • Python
        • Installation
        • Configuration
        • System Requirements
        • Data Redaction
        • Troubleshoot / Release Notes
          • Version 1.0
      • NodeJs
        • Installation
        • Configuration
        • System Requirements
        • Data Redaction
        • Troubleshoot / Release Notes
          • Version 1.0
      • Java
        • Installation
        • Run with IntelliJ
        • Configuration
        • System Requirements
        • Data Redaction
        • Troubleshoot / Release Notes
      • Go
        • Installation
        • Run with Goland
        • Run with Docker
        • Configuration
        • System Requirements
        • Data Redaction
    • 🎛️Conditional Expressions
    • 🏭Deploy within your firewall
    • 🍉Benchmarking impact on your system
      • Java
      • Go
    • Benchmarking impact on your system:
Powered by GitBook
On this page
  1. CtrlB Live Debug
  2. Agents
  3. Go

Installation

  1. Download our go heimdall agent by running the following command inside your application folder. This add the heimdall agent to the go.mod file:

go get -d github.com/ctrlb-hq/heimdall-go

At later point in time, you can update the package to latest version by running: go get -u github.com/ctrlb-hq/heimdall-go

  1. Import the heimdall package at the top of your main file as follows:

import (
    heimdall "github.com/ctrlb-hq/heimdall-go"
)
  1. In your main function, call heimdall.Start() as follows:

heimdall.Start(heimdall.AtlasOptions{
    Apikey:     "<your-api-key-here>",
})
  1. Use these build flags while building your application:

go build -gcflags="all=-N -l"

Avoid setting -w and -s ldflags. Doing so causes the compiler to strip the debug symbols from the binary which is needed by our agent.

If you're building on Alpine, remember to add tags -tags=alpine.

PreviousGoNextRun with Goland

Last updated 1 year ago