# Go Agent V2

## What is the Go Agent?

The SeaLights Go Agent provides code coverage and test intelligence for Go applications and services. It integrates directly into your Go build process to collect comprehensive coverage data during testing and deployment.

To provide coverage data, the agent performs automatic static instrumentation with zero third-party dependencies. This applies to both standalone Go applications and AWS Lambda functions (via SeaLights' Collector support).

### When/why to use this agent

Use the Go Agent when working with Go applications or Go test frameworks. You need to match the agent to the language of your Application Under Test or test runner:

* Go applications → Use Go Agent in Coverage Listener Mode
* Go test frameworks → Use Go Agent in Test Runner Mode

Golang does not support dynamic runtime instrumentation. Therefore, SeaLights uses build-time static instrumentation. This process prepends a lightweight registration call at the beginning of each method to track its execution during test runs. The method's original logic remains untouched. In effect, this achieves the same outcome as dynamic agents in other languages like Java or .NET — it simply occurs earlier in the development lifecycle.

<figure><img src="/files/D6zAE6yAT0SeEjiDtr2X" alt=""><figcaption></figcaption></figure>

### Supported environments/frameworks

#### Test Frameworks:

* Go's built-in testing package
* Ginkgo BDD framework
* Godog (Cucumber for Go)

#### Deployment Environments:

* AWS Lambda functions
* Pivotal Cloud Foundry (PCF)
* Docker containers
* Kubernetes clusters
* Traditional server deployments

#### Build Systems:

* Go modules (go.mod)
* Custom build scripts
* CI/CD pipelines (Jenkins, GitHub Actions, GitLab CI)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/go-agent/go-agent-v2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
