Registry / testing / testcontainers-testcontainer-go

testcontainers-testcontainer-go

JSON →
library0.42.0gogounverified

Testcontainers for Go provides lightweight, disposable containers for integration testing.

go get github.com/testcontainers/testcontainer-go
INSTALL
IMPORT
SIG · TESTCONTAINERS-TES
T
testcontainers-testcontainer-go
testinggov0.42.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

testcontainer
github.com/testcontainers/testcontainer-go

Starts a Redis container for testing

package main import ( "context" "fmt" "github.com/testcontainers/testcontainer-go" "github.com/testcontainers/testcontainer-go/wait" ) func main() { ctx := context.Background() req := testcontainer.ContainerRequest{ Image: "redis:latest", ExposedPorts: []string{"6379/tcp"}, WaitingFor: wait.ForLog("Ready to accept connections"), } redisC, _ := testcontainer.GenericContainer(ctx, testcontainer.GenericContainerRequest{ ContainerRequest: req, Started: true, }) defer redisC.Terminate(ctx) fmt.Println("Redis container started") }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.42.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources
testcontainers-testcontainer-go — go get testcontainers-testcontainer-go · libregistry