Use LoadStrike for Go load testing when the service team wants scenario code in Go and needs request or transaction evidence from self-hosted execution. The SDK uses Go callbacks, named steps and load simulations. A simple net/http request is a useful first test; a separate tracked completion signal is needed when a successful response only starts downstream work.
Go load testing with the LoadStrike SDK
Build Go load tests with LoadStrike, net/http and transaction reports. Check Go 1.26.8+, runner access and the installed cluster-capable version before evaluation.
How do you write a Go load test with LoadStrike?
Install and start an API load test in Go
The Go example is a package main request-step snippet using net/http. Replace the example target and runner key, review HTTP timeouts and errors, and use the published module instead of the sample project development replace directive.
The request-step example offers 10 scenario invocations per second for 20 seconds. Replace the example endpoint with an authorized staging service and the placeholder with your valid runner key. Offered scenario invocations are not measured HTTP throughput or a benchmark result.
SDK installation
Module path: loadstrike.com/sdk/go. v0.2.2 is the current maintenance release and requires Go 1.26.8 or later for the public module and matching runtime. The immutable v0.2.0 module metadata permits Go 1.26.5, but current users should update. The website serves the vanity-import metadata for this public path, so `go get` and pkg.go.dev resolve the GitHub repository automatically. Normal license validation remains required; unavailable or incompatible support fails before scenario callbacks or workload traffic starts. Use `go get` to install version v0.2.2 of loadstrike.com/sdk/go; following v0.2.0 publication, the last v0.1.x line remains on security-only support for at least 90 days.
go get loadstrike.com/sdk/go
import loadstrike "loadstrike.com/sdk/go"
Request-step example
package main
import (
"io"
"net/http"
"strconv"
loadstrike "loadstrike.com/sdk/go"
)
func main() {
scenario := loadstrike.CreateScenario("read-order", func(ctx loadstrike.LoadStrikeScenarioContext) loadstrike.LoadStrikeReply {
return loadstrike.LoadStrikeStep.Run("GET /orders/{id}", ctx, func(loadstrike.LoadStrikeScenarioContext) loadstrike.LoadStrikeReply {
request, err := http.NewRequest(http.MethodGet, "https://api.example.com/orders/ord-1001", nil)
if err != nil {
return loadstrike.LoadStrikeResponse.Fail("request_build_failed", int64(0), err.Error())
}
response, err := http.DefaultClient.Do(request)
if err != nil {
return loadstrike.LoadStrikeResponse.Fail("http_request_failed", int64(0), err.Error())
}
defer response.Body.Close()
_, _ = io.Copy(io.Discard, response.Body)
if response.StatusCode < 400 {
return loadstrike.LoadStrikeResponse.Ok(strconv.Itoa(response.StatusCode), int64(0), "ok")
}
return loadstrike.LoadStrikeResponse.Fail(strconv.Itoa(response.StatusCode), int64(0), "Order lookup failed")
})
}).
WithLoadSimulations(loadstrike.LoadStrikeSimulation.Inject(10, loadstrike.DurationFromSeconds(1), loadstrike.DurationFromSeconds(20)))
loadstrike.RegisterScenarios(scenario).
WithRunnerKey("rkl_your_local_runner_key").
Run()
}
Evidence to review
Use these pages and artifacts to validate the public claims on this page.
Go package and releases
Check the published package version before installing or pinning a dependency.
Go sample project
Inspect the project configuration, imports and source examples. Dummy runner keys must be replaced.
Installation and runtime requirements
Confirm supported runtime, optional clients and runner setup.
Who this is for
Go service owners and platform engineers who want to keep performance scenarios in their normal Go project. The HTTP example handles request and transport failures, drains the response body and maps status into a LoadStrike reply rather than assuming that every invocation succeeded.
Package, runtime and client setup
The current documented maintenance release is v0.2.2. Use go get to install version v0.2.2 of the module loadstrike.com/sdk/go on Go 1.26.8+ and import loadstrike "loadstrike.com/sdk/go". Use the public module path rather than copying a local replace directive from a development project. Configure a valid runner key; unavailable or incompatible required support fails before scenario callbacks or target traffic starts.
From request timing to completion
Go tests can model a source action and downstream completion with a shared tracking value, endpoint modes and a correlation timeout. Check transport support against the selected SDK and plan. gRPC execution is delegate-backed: your generated gRPC client performs the call and supplies the produced or consumed result; native gRPC execution is unavailable.
Execution and plan requirements
- Use Go module loadstrike.com/sdk/go on Go 1.26.8+ and provide a valid runner key. LoadStrike runs on your own infrastructure.
- Check the plan for the selected endpoints, reports and execution mode. gRPC and WebSocket endpoints require Pro or Enterprise; extra clients do not grant plan access.
- Review HTML, CSV, TXT or Markdown reports and run failures. These examples demonstrate SDK setup; they are not comparative benchmarks or throughput guarantees.
Define the workload and inspect the evidence
Start with a small request-step test against a staging system you control. To measure later completion, define the matching endpoints and tracking value before interpreting transaction latency.
Go request-step quick start
Set the language tab, replace the example target and configure runner access.
Tracking selectors
Verify that the same identifier reaches source and completion.
Report interpretation
Read summary, step timings, failed rows and correlated outcomes.
Introduce the workload into your test project
- Keep an existing Go benchmark for its original purpose and add a staging service scenario for network, broker or transaction behavior. A microbenchmark and an end-to-end workload answer different performance questions.
- The updated Go SDK supports local children and separate NATS agents. Remote V2 requires Go SDK v0.2.2 and its matching runtime. Local agents share machine capacity; start NATS separately.
Common questions
Can Go run distributed LoadStrike agents?
Yes, in the updated Go SDK with a compatible runtime. Use separate NATS agent processes with matching session settings and stable identities; the coordinator needs an entitled runner key. Use Go SDK v0.2.2 with its matching runtime and check the cluster guide.
Does the Go Playwright example launch a browser?
The Go lifecycle skeleton does not implement browser actions. The Playwright protocol guide provides concrete client examples for other languages. Do not treat that skeleton as a working Go browser integration.
Related documentation
Start with the implementation details that match this page.
Installation
Install the LoadStrike package for your language and add it to the test project you already use. This page is the starting point before you write a scenario.
Quick Start
Build one basic request-step scenario around GET /orders/{id}, run it, and confirm the report before moving into correlation-specific features.
Load Simulation
Load simulations describe how traffic should arrive over time. Use them to model the shape of the workload instead of only its peak.
Cluster Overview
Cluster mode lets one LoadStrike run spread across multiple nodes. Use it when a single machine is not enough or when topology matters.
Related comparisons
Use these comparison pages if you still need a tool-level decision.
LoadStrike vs k6
Compare LoadStrike and k6 for APIs, Kafka, browser tests and async completion, including correlation requirements, extensions and hosting tradeoffs.
LoadStrike vs Apache JMeter
Compare LoadStrike and Apache JMeter for async completion, JMS, browser execution, reports and self-hosted testing, including setup and licensing requirements.
Next steps
All SDKs and documentation
Choose another language or find the transport guide for your workload.
Transaction load testing
Decide which downstream event represents the real completion outcome.
Plans and runner access
Verify entitlements and current self-hosted pricing before rollout.
Start one Go performance scenario
Install the SDK, provide a valid runner key and review one small staging run before increasing load or adding downstream correlation.