Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// README at: https://github.com/devcontainers/templates/tree/main/src/go
{
"name": "Go",
"image": "mcr.microsoft.com/devcontainers/go:1.25-trixie",
"image": "mcr.microsoft.com/devcontainers/go:1.26-trixie",

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
Expand Down
10 changes: 5 additions & 5 deletions AI.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ This is a **Go monorepo** containing:
## Environment Setup

### Go Version
- **Required**: Go 1.25.9
- **Required**: Go 1.26
- **Tool**: Use [gvm](https://github.com/andrewkroh/gvm) for version management
- **CRITICAL**: Always run this before ANY Go command:
```bash
# For Apple Silicon (M1/M2/M3)
eval "$(gvm 1.25.9 --arch=arm64)"
eval "$(gvm 1.26 --arch=arm64)"

# For Intel/AMD (x86_64)
eval "$(gvm 1.25.9 --arch=amd64)"
eval "$(gvm 1.26 --arch=amd64)"
```

### Project Structure
Expand Down Expand Up @@ -171,14 +171,14 @@ func Run(ctx context.Context, img string, opts ...testcontainers.ContainerCustom
### When Tests Fail
1. **Read the error message carefully** - it usually tells you exactly what's wrong
2. **Check if it's a lint issue** - run `make pre-commit` first
3. **Verify Go version** - ensure using Go 1.25.9
3. **Verify Go version** - ensure using Go 1.26
4. **Check Docker** - some tests require Docker daemon running

## Common Pitfalls to Avoid

### Code Issues
- ❌ Using interface types as return values
- ❌ Forgetting to run `eval "$(gvm 1.25.9 --arch=arm64)"`
- ❌ Forgetting to run `eval "$(gvm 1.26 --arch=arm64)"`
- ❌ Not handling errors from built-in options
- ❌ Using module-specific container names (`PostgresContainer`)
- ❌ Calling `.Customize()` method instead of direct function call
Expand Down
2 changes: 1 addition & 1 deletion docker_mounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func mapToDockerMounts(containerMounts ContainerMounts) []mount.Mount {
case ImageMounter:
containerMount.ImageOptions = typedMounter.ImageOptions()
case BindMounter:
log.Printf("Mount type %s is not supported by Testcontainers for Go", m.Source.Type())
log.Printf("Mount type %d is not supported by Testcontainers for Go", m.Source.Type())
default:
// The provided source type has no custom options
}
Expand Down
2 changes: 1 addition & 1 deletion docs/system_requirements/ci/aws_codebuild.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ version: 0.2
phases:
install:
runtime-versions:
golang: 1.25
golang: 1.26
build:
commands:
- go test ./...
Expand Down
2 changes: 1 addition & 1 deletion docs/system_requirements/ci/circle_ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ workflows:
- tests:
matrix:
parameters:
go-version: ["1.25.9", "1.26.2"]
go-version: ["1.26"]

```

Expand Down
2 changes: 1 addition & 1 deletion docs/system_requirements/ci/concourse_ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
start_docker

cd repo
docker run -it --rm -v "$PWD:$PWD" -w "$PWD" -v /var/run/docker.sock:/var/run/docker.sock golang:1.25 go test ./...
docker run -it --rm -v "$PWD:$PWD" -w "$PWD" -v /var/run/docker.sock:/var/run/docker.sock golang:1.26 go test ./...
```

Finally, you can use Concourse's [fly CLI](https://concourse-ci.org/fly.html) to set the pipeline and trigger the job:
Expand Down
4 changes: 2 additions & 2 deletions docs/system_requirements/ci/dind_patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ $ tree .
└── platform
└── integration_test.go

$ docker run -it --rm -v $PWD:$PWD -w $PWD -v /var/run/docker.sock:/var/run/docker.sock golang:1.25 go test ./... -v
$ docker run -it --rm -v $PWD:$PWD -w $PWD -v /var/run/docker.sock:/var/run/docker.sock golang:1.26 go test ./... -v
```

Where:
Expand All @@ -45,7 +45,7 @@ The same can be achieved with Docker Compose:

```yaml
tests:
image: golang:1.25
image: golang:1.26
stop_signal: SIGKILL
stdin_open: true
tty: true
Expand Down
2 changes: 1 addition & 1 deletion docs/system_requirements/ci/gitlab_ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ variables:
DOCKER_DRIVER: overlay2

test:
image: golang:1.25
image: golang:1.26
stage: test
script: go test ./... -v
```
2 changes: 1 addition & 1 deletion docs/system_requirements/ci/tekton.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
- name: source
steps:
- name: read
image: golang:1.25
image: golang:1.26
workingDir: $(workspaces.source.path)
script: go test ./... -v
volumeMounts:
Expand Down
4 changes: 1 addition & 3 deletions examples/nginx/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/testcontainers/testcontainers-go/examples/nginx

go 1.25.0

toolchain go1.25.9
go 1.26

require (
github.com/stretchr/testify v1.11.1
Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/testcontainers/testcontainers-go

go 1.25.0

toolchain go1.25.9
go 1.26

require (
dario.cat/mergo v1.0.2
Expand Down
4 changes: 1 addition & 3 deletions modulegen/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/testcontainers/testcontainers-go/modulegen

go 1.25.0

toolchain go1.25.9
go 1.26

require (
github.com/spf13/cobra v1.10.2
Expand Down
4 changes: 1 addition & 3 deletions modules/activemq/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/testcontainers/testcontainers-go/modules/activemq

go 1.25.0

toolchain go1.25.9
go 1.26

require (
github.com/stretchr/testify v1.11.1
Expand Down
4 changes: 1 addition & 3 deletions modules/aerospike/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/testcontainers/testcontainers-go/modules/aerospike

go 1.25.0

toolchain go1.25.9
go 1.26

require (
github.com/aerospike/aerospike-client-go/v8 v8.7.0
Expand Down
4 changes: 1 addition & 3 deletions modules/arangodb/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/testcontainers/testcontainers-go/modules/arangodb

go 1.25.0

toolchain go1.25.9
go 1.26

require (
github.com/arangodb/go-driver/v2 v2.3.1
Expand Down
4 changes: 1 addition & 3 deletions modules/artemis/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/testcontainers/testcontainers-go/modules/artemis

go 1.25.0

toolchain go1.25.9
go 1.26

require (
github.com/go-stomp/stomp/v3 v3.1.5
Expand Down
4 changes: 1 addition & 3 deletions modules/azure/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/testcontainers/testcontainers-go/modules/azure

go 1.25.7

toolchain go1.25.9
go 1.26

require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.22.0
Expand Down
2 changes: 1 addition & 1 deletion modules/azure/lowkeyvault/testdata/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.25-alpine@sha256:8e02eb337d9e0ea459e041f1ee5eece41cbb61f1d83e7d883a3e2fb4862063fa as builder
FROM golang:1.26-alpine@sha256:0178a641fbb4858c5f1b48e34bdaabe0350a330a1b1149aabd498d0699ff5fb2 as builder
WORKDIR /app
COPY . .
RUN mkdir -p dist
Expand Down
4 changes: 1 addition & 3 deletions modules/azure/lowkeyvault/testdata/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module lowkeyvault_network_test

go 1.25.0

toolchain go1.25.9
go 1.26

require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0
Expand Down
4 changes: 1 addition & 3 deletions modules/azurite/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/testcontainers/testcontainers-go/modules/azurite

go 1.25.7

toolchain go1.25.9
go 1.26

require (
github.com/stretchr/testify v1.11.1
Expand Down
4 changes: 2 additions & 2 deletions modules/azurite/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ github.com/Azure/azure-sdk-for-go/sdk/data/aztables v1.3.0 h1:NnE8y/opvxowwNcSNH
github.com/Azure/azure-sdk-for-go/sdk/data/aztables v1.3.0/go.mod h1:GhHzPHiiHxZloo6WvKu9X7krmSAKTyGoIwoKMbrKTTA=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.12.0 h1:fhqpLE3UEXi9lPaBRpQ6XuRW0nU7hgg4zlmZZa+a9q4=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.12.0/go.mod h1:7dCRMLwisfRH3dBupKeNCioWYUZ4SS09Z14H+7i8ZoY=
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.0 h1:UXT0o77lXQrikd1kgwIPQOUect7EoR/+sbP4wQKdzxM=
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.0/go.mod h1:cTvi54pg19DoT07ekoeMgE/taAwNtCShVeZqA+Iv2xI=
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.8.0 h1:irsmOWwkp0KCTTNS5e2hdFeIvSQClQo2No3IaNmL3Vw=
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.8.0/go.mod h1:GWcBkQj3MqN7ozHKLaCCAuNLiXoIGv2RtanfAwSjY/Y=
github.com/Azure/azure-sdk-for-go/sdk/storage/azqueue v1.0.0 h1:lJwNFV+xYjHREUTHJKx/ZF6CJSt9znxmLw9DqSTvyRU=
github.com/Azure/azure-sdk-for-go/sdk/storage/azqueue v1.0.0/go.mod h1:GfT0aGew8Qj5yiQVqOO5v7N8fanbJGyUoHqXg56qcVY=
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg=
Expand Down
4 changes: 1 addition & 3 deletions modules/cassandra/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/testcontainers/testcontainers-go/modules/cassandra

go 1.25.0

toolchain go1.25.9
go 1.26

require (
github.com/gocql/gocql v1.6.0
Expand Down
4 changes: 1 addition & 3 deletions modules/chroma/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/testcontainers/testcontainers-go/modules/chroma

go 1.25.0

toolchain go1.25.9
go 1.26

require (
github.com/amikos-tech/chroma-go v0.3.2
Expand Down
4 changes: 1 addition & 3 deletions modules/clickhouse/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/testcontainers/testcontainers-go/modules/clickhouse

go 1.25.0

toolchain go1.25.9
go 1.26

require (
github.com/ClickHouse/clickhouse-go/v2 v2.34.0
Expand Down
4 changes: 1 addition & 3 deletions modules/cockroachdb/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/testcontainers/testcontainers-go/modules/cockroachdb

go 1.25.0

toolchain go1.25.9
go 1.26

require (
github.com/jackc/pgx/v5 v5.9.2
Expand Down
2 changes: 1 addition & 1 deletion modules/compose/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/testcontainers/testcontainers-go/modules/compose

go 1.25.9
go 1.26

replace github.com/testcontainers/testcontainers-go => ../..

Expand Down
4 changes: 1 addition & 3 deletions modules/consul/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/testcontainers/testcontainers-go/modules/consul

go 1.25.0

toolchain go1.25.9
go 1.26

require (
github.com/hashicorp/consul/api v1.27.0
Expand Down
4 changes: 1 addition & 3 deletions modules/couchbase/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/testcontainers/testcontainers-go/modules/couchbase

go 1.25.0

toolchain go1.25.9
go 1.26

require (
github.com/cenkalti/backoff/v4 v4.3.0
Expand Down
2 changes: 1 addition & 1 deletion modules/couchdb/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/testcontainers/testcontainers-go/modules/couchdb

go 1.25.0
go 1.26

require (
github.com/stretchr/testify v1.11.1
Expand Down
2 changes: 1 addition & 1 deletion modules/cratedb/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/testcontainers/testcontainers-go/modules/cratedb

go 1.25.0
go 1.26

require (
github.com/stretchr/testify v1.11.1
Expand Down
4 changes: 1 addition & 3 deletions modules/databend/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/testcontainers/testcontainers-go/modules/databend

go 1.25.0

toolchain go1.25.9
go 1.26

require (
github.com/datafuselabs/databend-go v0.7.0
Expand Down
4 changes: 1 addition & 3 deletions modules/dex/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/testcontainers/testcontainers-go/modules/dex

go 1.25.0

toolchain go1.25.9
go 1.26

require (
github.com/coreos/go-oidc/v3 v3.18.0
Expand Down
4 changes: 1 addition & 3 deletions modules/dind/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/testcontainers/testcontainers-go/modules/dind

go 1.25.0

toolchain go1.25.9
go 1.26

require (
github.com/moby/moby/api v1.55.0
Expand Down
4 changes: 1 addition & 3 deletions modules/dockermcpgateway/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/testcontainers/testcontainers-go/modules/dockermcpgateway

go 1.25.0

toolchain go1.25.9
go 1.26

require (
github.com/moby/moby/api v1.55.0
Expand Down
4 changes: 1 addition & 3 deletions modules/dockermodelrunner/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/testcontainers/testcontainers-go/modules/dockermodelrunner

go 1.25.0

toolchain go1.25.9
go 1.26

require (
github.com/moby/moby/client v0.5.0
Expand Down
2 changes: 1 addition & 1 deletion modules/dockermodelrunner/internal/sdk/client/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (c *Client) PullModel(ctx context.Context, fullyQualifiedModelName string)
scanner := bufio.NewScanner(resp.Body)
// TODO: use a progressbar instead of multiple line output.
for scanner.Scan() {
logger.Printf(scanner.Text())
logger.Printf("%s", scanner.Text())
}

if err := scanner.Err(); err != nil {
Expand Down
4 changes: 1 addition & 3 deletions modules/dolt/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/testcontainers/testcontainers-go/modules/dolt

go 1.25.0

toolchain go1.25.9
go 1.26

require (
github.com/go-sql-driver/mysql v1.7.1
Expand Down
4 changes: 1 addition & 3 deletions modules/dynamodb/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/testcontainers/testcontainers-go/modules/dynamodb

go 1.25.0

toolchain go1.25.9
go 1.26

require (
github.com/aws/aws-sdk-go-v2 v1.31.0
Expand Down
Loading
Loading