diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 2d0049f26b..06d03d635f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -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": {}, diff --git a/.github/workflows/ci-lint-go.yml b/.github/workflows/ci-lint-go.yml index 1df4bb8197..7df7bfed92 100644 --- a/.github/workflows/ci-lint-go.yml +++ b/.github/workflows/ci-lint-go.yml @@ -33,7 +33,7 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 with: - version: v2.9.0 + version: v2.14.0 # Optional: working directory, useful for monorepos working-directory: ${{ inputs.project-directory }} diff --git a/.github/workflows/ci-test-go.yml b/.github/workflows/ci-test-go.yml index 6b51ae7417..9f84deb984 100644 --- a/.github/workflows/ci-test-go.yml +++ b/.github/workflows/ci-test-go.yml @@ -72,30 +72,11 @@ jobs: cache-dependency-path: '${{ inputs.project-directory }}/go.sum' id: go - - name: Check Go version compatibility - id: go-compat - shell: bash - run: | - # Modules that require Go 1.26+ and do not support Go 1.25.x - NO_SUPPORT_125=("modules/weaviate") - - SKIP=false - for mod in "${NO_SUPPORT_125[@]}"; do - if [[ "${{ inputs.project-directory }}" == "${mod}" ]] && [[ "${{ inputs.go-version }}" == 1.25.* ]]; then - echo "Skipping: ${mod} does not support Go 1.25.x" - SKIP=true - break - fi - done - echo "skip=${SKIP}" >> $GITHUB_OUTPUT - - name: ensure compilation - if: steps.go-compat.outputs.skip != 'true' working-directory: ./${{ inputs.project-directory }} run: go build ./... - name: Install dependencies - if: steps.go-compat.outputs.skip != 'true' shell: bash run: | SCRIPT_PATH="./.github/scripts/${{ inputs.project-directory }}/install-dependencies.sh" @@ -107,25 +88,23 @@ jobs: # Setup Testcontainers Cloud Client right before your Testcontainers tests - name: Setup Testcontainers Cloud Client - if: ${{ inputs.testcontainers-cloud && steps.go-compat.outputs.skip != 'true' }} + if: ${{ inputs.testcontainers-cloud }} uses: atomicjar/testcontainers-cloud-setup-action@7d1bab3fdfe0027c91936deca6b924d8a8a7a04d # v1.3 with: token: ${{ secrets.TCC_TOKEN }} - name: go test - if: steps.go-compat.outputs.skip != 'true' working-directory: ./${{ inputs.project-directory }} timeout-minutes: 30 run: make test-unit - name: Run checker - if: steps.go-compat.outputs.skip != 'true' run: | ./scripts/check_environment.sh # (Optionally) When you don't need Testcontainers Cloud anymore, you could terminate sessions eagerly - name: Terminate Testcontainers Cloud Client active sessions - if: ${{ inputs.testcontainers-cloud && steps.go-compat.outputs.skip != 'true' }} + if: ${{ inputs.testcontainers-cloud }} uses: atomicjar/testcontainers-cloud-setup-action@7d1bab3fdfe0027c91936deca6b924d8a8a7a04d # v1.3 with: action: terminate @@ -134,12 +113,12 @@ jobs: uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4 with: paths: "**/${{ inputs.project-directory }}/TEST-unit*.xml" - if: ${{ always() && steps.go-compat.outputs.skip != 'true' }} + if: always() - name: Decide if Sonar must be run - if: ${{ matrix.platform == 'ubuntu-latest' && steps.go-compat.outputs.skip != 'true' }} + if: ${{ matrix.platform == 'ubuntu-latest' }} run: | - if [[ "1.25.x" == "${{ inputs.go-version }}" ]] && \ + if [[ "1.26.x" == "${{ inputs.go-version }}" ]] && \ [[ "true" != "${{ inputs.rootless-docker }}" ]] && \ [[ "true" != "${{ inputs.testcontainers-cloud }}" ]] && \ [[ "true" != "${{ inputs.ryuk-disabled }}" ]] && \ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 282373daf2..5ce1c974ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,7 +61,7 @@ jobs: # We don't want to fail the build the soonest but identify which modules passed and failed. fail-fast: false matrix: - go-version: [1.25.x, 1.26.x] + go-version: [1.26.x, 1.27.x] module: ${{ fromJSON(needs.detect-modules.outputs.modules) }} exclude: # The Quay MinIO image requires credentials not available in CI. @@ -91,7 +91,7 @@ jobs: # We don't want to fail the build the soonest but identify which modules passed and failed. fail-fast: false matrix: - go-version: [1.25.x, 1.26.x] + go-version: [1.26.x, 1.27.x] uses: ./.github/workflows/ci-test-go.yml with: go-version: ${{ matrix.go-version }} @@ -112,7 +112,7 @@ jobs: name: "Test with reaper off" strategy: matrix: - go-version: [1.25.x, 1.26.x] + go-version: [1.26.x, 1.27.x] uses: ./.github/workflows/ci-test-go.yml with: go-version: ${{ matrix.go-version }} @@ -133,7 +133,7 @@ jobs: name: "Test with Rootless Docker" strategy: matrix: - go-version: [1.25.x, 1.26.x] + go-version: [1.26.x, 1.27.x] uses: ./.github/workflows/ci-test-go.yml with: go-version: ${{ matrix.go-version }} diff --git a/AI.md b/AI.md index f90971bb83..0acbab8b5b 100644 --- a/AI.md +++ b/AI.md @@ -14,15 +14,15 @@ This is a **Go monorepo** containing: ## Environment Setup ### Go Version -- **Required**: Go 1.25.9 +- **Required**: Go 1.26.8 - **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.8 --arch=arm64)" # For Intel/AMD (x86_64) - eval "$(gvm 1.25.9 --arch=amd64)" + eval "$(gvm 1.26.8 --arch=amd64)" ``` ### Project Structure @@ -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.8 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.8 --arch=arm64)"` - ❌ Not handling errors from built-in options - ❌ Using module-specific container names (`PostgresContainer`) - ❌ Calling `.Customize()` method instead of direct function call diff --git a/cleanup.go b/cleanup.go index 2f84486367..f8aed0a2e2 100644 --- a/cleanup.go +++ b/cleanup.go @@ -117,7 +117,7 @@ func isNil(val any) bool { valueOf := reflect.ValueOf(val) switch valueOf.Kind() { - case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + case reflect.Chan, reflect.Func, reflect.Map, reflect.Pointer, reflect.UnsafePointer, reflect.Interface, reflect.Slice: return valueOf.IsNil() default: return false diff --git a/commons-test.mk b/commons-test.mk index a3381c5d69..e4fd875e64 100644 --- a/commons-test.mk +++ b/commons-test.mk @@ -6,7 +6,7 @@ define go_install endef $(GOBIN)/golangci-lint: - $(call go_install,github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.9.0) + $(call go_install,github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.14.0) $(GOBIN)/gotestsum: $(call go_install,gotest.tools/gotestsum@latest) diff --git a/docker_mounts.go b/docker_mounts.go index 5d654b9a60..fb00316ffd 100644 --- a/docker_mounts.go +++ b/docker_mounts.go @@ -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 %s is not supported by Testcontainers for Go", mountTypeMapping[m.Source.Type()]) default: // The provided source type has no custom options } diff --git a/docs/features/docker_compose.md b/docs/features/docker_compose.md index 3958c9beb4..2ceef4a12e 100644 --- a/docs/features/docker_compose.md +++ b/docs/features/docker_compose.md @@ -10,7 +10,7 @@ dependent upon. ## Using `docker compose` directly !!!warning - The minimal version of Go required to use this module is **1.21**. + The minimal version of Go required to use this module is **1.26**. ``` go get github.com/testcontainers/testcontainers-go/modules/compose diff --git a/docs/system_requirements/ci/aws_codebuild.md b/docs/system_requirements/ci/aws_codebuild.md index 0e4fede30b..960f0e733f 100644 --- a/docs/system_requirements/ci/aws_codebuild.md +++ b/docs/system_requirements/ci/aws_codebuild.md @@ -11,7 +11,7 @@ version: 0.2 phases: install: runtime-versions: - golang: 1.25 + golang: 1.26 build: commands: - go test ./... diff --git a/docs/system_requirements/ci/circle_ci.md b/docs/system_requirements/ci/circle_ci.md index 8d27364b94..70c83a7926 100644 --- a/docs/system_requirements/ci/circle_ci.md +++ b/docs/system_requirements/ci/circle_ci.md @@ -57,7 +57,7 @@ workflows: - tests: matrix: parameters: - go-version: ["1.25.9", "1.26.2"] + go-version: ["1.26.8", "1.27.1"] ``` diff --git a/docs/system_requirements/ci/concourse_ci.md b/docs/system_requirements/ci/concourse_ci.md index adb6921cfa..7b1d7febe5 100644 --- a/docs/system_requirements/ci/concourse_ci.md +++ b/docs/system_requirements/ci/concourse_ci.md @@ -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: diff --git a/docs/system_requirements/ci/dind_patterns.md b/docs/system_requirements/ci/dind_patterns.md index 74245b07fc..cfdb3683b3 100644 --- a/docs/system_requirements/ci/dind_patterns.md +++ b/docs/system_requirements/ci/dind_patterns.md @@ -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: @@ -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 diff --git a/docs/system_requirements/ci/gitlab_ci.md b/docs/system_requirements/ci/gitlab_ci.md index cf4cd7319d..b70a3a5795 100644 --- a/docs/system_requirements/ci/gitlab_ci.md +++ b/docs/system_requirements/ci/gitlab_ci.md @@ -57,7 +57,7 @@ variables: DOCKER_DRIVER: overlay2 test: - image: golang:1.25 + image: golang:1.26 stage: test script: go test ./... -v ``` diff --git a/docs/system_requirements/ci/tekton.md b/docs/system_requirements/ci/tekton.md index 266abe76d8..bc5e3803ea 100644 --- a/docs/system_requirements/ci/tekton.md +++ b/docs/system_requirements/ci/tekton.md @@ -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: diff --git a/examples/nginx/go.mod b/examples/nginx/go.mod index a6d9207c6c..4291bb2625 100644 --- a/examples/nginx/go.mod +++ b/examples/nginx/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/examples/nginx -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/stretchr/testify v1.11.1 diff --git a/go.mod b/go.mod index a6c618424a..582ff29186 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( dario.cat/mergo v1.0.2 diff --git a/logconsumer_test.go b/logconsumer_test.go index 4b2e872b96..3f5a4dbb8c 100644 --- a/logconsumer_test.go +++ b/logconsumer_test.go @@ -62,7 +62,7 @@ func (g *TestLogConsumer) Msgs() []string { func devNullAcceptorChan() chan string { c := make(chan string) go func(c <-chan string) { - for range c { //nolint:revive // do nothing, just pull off channel + for range c { } }(c) return c diff --git a/modulegen/go.mod b/modulegen/go.mod index 6807187ee7..e7aae50258 100644 --- a/modulegen/go.mod +++ b/modulegen/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modulegen -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/spf13/cobra v1.10.2 diff --git a/modules/activemq/go.mod b/modules/activemq/go.mod index 86533ae729..962ada7e79 100644 --- a/modules/activemq/go.mod +++ b/modules/activemq/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/activemq -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/stretchr/testify v1.11.1 diff --git a/modules/aerospike/go.mod b/modules/aerospike/go.mod index 5e22fdfdce..24ec9f2d20 100644 --- a/modules/aerospike/go.mod +++ b/modules/aerospike/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/aerospike -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/aerospike/aerospike-client-go/v8 v8.7.0 diff --git a/modules/arangodb/go.mod b/modules/arangodb/go.mod index 174748095f..37d917256e 100644 --- a/modules/arangodb/go.mod +++ b/modules/arangodb/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/arangodb -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/arangodb/go-driver/v2 v2.3.1 diff --git a/modules/artemis/go.mod b/modules/artemis/go.mod index cf19ab8023..31cbe7affa 100644 --- a/modules/artemis/go.mod +++ b/modules/artemis/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/artemis -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/go-stomp/stomp/v3 v3.1.5 diff --git a/modules/azure/azurite/options.go b/modules/azure/azurite/options.go index 1666894c7c..5cf58bae79 100644 --- a/modules/azure/azurite/options.go +++ b/modules/azure/azurite/options.go @@ -18,7 +18,7 @@ func defaultOptions() options { } // Satisfy the testcontainers.ContainerCustomizer interface -var _ testcontainers.ContainerCustomizer = (Option)(nil) +var _ testcontainers.ContainerCustomizer = Option(nil) // Option is an option for the Azurite container. type Option func(*options) error diff --git a/modules/azure/eventhubs/options.go b/modules/azure/eventhubs/options.go index 4fb95ffc77..a26ae9c6c6 100644 --- a/modules/azure/eventhubs/options.go +++ b/modules/azure/eventhubs/options.go @@ -39,7 +39,7 @@ func defaultOptions() options { } // Satisfy the testcontainers.ContainerCustomizer interface -var _ testcontainers.ContainerCustomizer = (Option)(nil) +var _ testcontainers.ContainerCustomizer = Option(nil) // Option is an option for the EventHubs container. type Option func(*options) error diff --git a/modules/azure/go.mod b/modules/azure/go.mod index 10f406ad36..c568152f17 100644 --- a/modules/azure/go.mod +++ b/modules/azure/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/azure -go 1.25.7 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.22.0 diff --git a/modules/azure/lowkeyvault/testdata/Dockerfile b/modules/azure/lowkeyvault/testdata/Dockerfile index 9003b95f06..237d27e194 100644 --- a/modules/azure/lowkeyvault/testdata/Dockerfile +++ b/modules/azure/lowkeyvault/testdata/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.25-alpine@sha256:8e02eb337d9e0ea459e041f1ee5eece41cbb61f1d83e7d883a3e2fb4862063fa as builder +FROM golang:1.26-alpine@sha256:8ac98ca534ac3f51e1f420a1dd2c15e74c75cfa0f23f3ad27eb5d7236c349a0c as builder WORKDIR /app COPY . . RUN mkdir -p dist diff --git a/modules/azure/lowkeyvault/testdata/go.mod b/modules/azure/lowkeyvault/testdata/go.mod index b9e9332189..2907dad066 100644 --- a/modules/azure/lowkeyvault/testdata/go.mod +++ b/modules/azure/lowkeyvault/testdata/go.mod @@ -1,8 +1,8 @@ module lowkeyvault_network_test -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0 diff --git a/modules/azure/lowkeyvault/testdata/main.go b/modules/azure/lowkeyvault/testdata/main.go index 7cd36857b7..43ec4bf1fa 100644 --- a/modules/azure/lowkeyvault/testdata/main.go +++ b/modules/azure/lowkeyvault/testdata/main.go @@ -18,16 +18,16 @@ import ( func run() error { ctx := context.Background() - connUrl := os.Getenv("CONNECTION_URL") - log.Printf("Using Lowkey Vault endpoint: %s", connUrl) - tokenUrl := os.Getenv("IDENTITY_ENDPOINT") - log.Printf("Using token URL: %s", tokenUrl) + connURL := os.Getenv("CONNECTION_URL") + log.Printf("Using Lowkey Vault endpoint: %s", connURL) + tokenURL := os.Getenv("IDENTITY_ENDPOINT") + log.Printf("Using token URL: %s", tokenURL) customTransport := http.DefaultTransport.(*http.Transport).Clone() customTransport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true} httpClient := http.Client{Transport: customTransport} - resp, err := httpClient.Get(tokenUrl + "?resource=" + connUrl) + resp, err := httpClient.Get(tokenURL + "?resource=" + connURL) if err != nil { log.Fatalf("failed to get token from token URL %v", err) return err @@ -43,7 +43,7 @@ func run() error { log.Fatalf("failed to create credential: %v", err) return err } - secretClient, err := azsecrets.NewClient(connUrl, + secretClient, err := azsecrets.NewClient(connURL, cred, &azsecrets.ClientOptions{ClientOptions: struct { APIVersion string @@ -75,7 +75,7 @@ func run() error { log.Fatalf("failed to get the secret %v", err) return err } - fetchedValue := *fetched.Secret.Value + fetchedValue := *fetched.Value fmt.Println(fetchedValue == secretValue) diff --git a/modules/azure/servicebus/options.go b/modules/azure/servicebus/options.go index f9396515b6..dc974d2a64 100644 --- a/modules/azure/servicebus/options.go +++ b/modules/azure/servicebus/options.go @@ -24,7 +24,7 @@ func defaultOptions() options { } // Satisfy the testcontainers.ContainerCustomizer interface -var _ testcontainers.ContainerCustomizer = (Option)(nil) +var _ testcontainers.ContainerCustomizer = Option(nil) // Option is an option for the ServiceBus container. type Option func(*options) error diff --git a/modules/azurite/go.mod b/modules/azurite/go.mod index ed7c3a23f0..9ebd6188eb 100644 --- a/modules/azurite/go.mod +++ b/modules/azurite/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/azurite -go 1.25.7 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/stretchr/testify v1.11.1 diff --git a/modules/cassandra/go.mod b/modules/cassandra/go.mod index c3c6e05785..28b4c931fc 100644 --- a/modules/cassandra/go.mod +++ b/modules/cassandra/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/cassandra -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/gocql/gocql v1.6.0 diff --git a/modules/cassandra/options.go b/modules/cassandra/options.go index 1c67c7560d..f289b2562e 100644 --- a/modules/cassandra/options.go +++ b/modules/cassandra/options.go @@ -13,7 +13,7 @@ type options struct { } // Compiler check to ensure that Option implements the testcontainers.ContainerCustomizer interface. -var _ testcontainers.ContainerCustomizer = (Option)(nil) +var _ testcontainers.ContainerCustomizer = Option(nil) // Option is an option for the Cassandra container. type Option func(*options) error diff --git a/modules/chroma/go.mod b/modules/chroma/go.mod index bbfee5deca..58c20ada3a 100644 --- a/modules/chroma/go.mod +++ b/modules/chroma/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/chroma -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/amikos-tech/chroma-go v0.3.2 diff --git a/modules/clickhouse/go.mod b/modules/clickhouse/go.mod index 2fe510a7cb..3d656b0fbc 100644 --- a/modules/clickhouse/go.mod +++ b/modules/clickhouse/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/clickhouse -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/ClickHouse/clickhouse-go/v2 v2.34.0 diff --git a/modules/cockroachdb/go.mod b/modules/cockroachdb/go.mod index 1805fddf69..12aa6f694a 100644 --- a/modules/cockroachdb/go.mod +++ b/modules/cockroachdb/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/cockroachdb -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/jackc/pgx/v5 v5.9.2 diff --git a/modules/compose/go.mod b/modules/compose/go.mod index be454977ae..e96f13748a 100644 --- a/modules/compose/go.mod +++ b/modules/compose/go.mod @@ -1,6 +1,6 @@ module github.com/testcontainers/testcontainers-go/modules/compose -go 1.25.9 +go 1.26.0 replace github.com/testcontainers/testcontainers-go => ../.. diff --git a/modules/compose/testdata/echoserver.Dockerfile b/modules/compose/testdata/echoserver.Dockerfile index 98a34199d9..79d54a8e0d 100644 --- a/modules/compose/testdata/echoserver.Dockerfile +++ b/modules/compose/testdata/echoserver.Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.24-alpine@sha256:fc2cff6625f3c1c92e6c85938ac5bd09034ad0d4bc2dfb08278020b68540dbb5 +FROM golang:1.26-alpine@sha256:8ac98ca534ac3f51e1f420a1dd2c15e74c75cfa0f23f3ad27eb5d7236c349a0c WORKDIR /app diff --git a/modules/consul/go.mod b/modules/consul/go.mod index ba37f5ef57..9dda75d868 100644 --- a/modules/consul/go.mod +++ b/modules/consul/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/consul -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/hashicorp/consul/api v1.27.0 diff --git a/modules/couchbase/go.mod b/modules/couchbase/go.mod index 1f536a7a7a..5e501cca45 100644 --- a/modules/couchbase/go.mod +++ b/modules/couchbase/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/couchbase -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/cenkalti/backoff/v4 v4.3.0 diff --git a/modules/couchdb/go.mod b/modules/couchdb/go.mod index 273d75cb22..6b9e358d29 100644 --- a/modules/couchdb/go.mod +++ b/modules/couchdb/go.mod @@ -1,6 +1,6 @@ module github.com/testcontainers/testcontainers-go/modules/couchdb -go 1.25.0 +go 1.26.0 require ( github.com/stretchr/testify v1.11.1 diff --git a/modules/cratedb/go.mod b/modules/cratedb/go.mod index 3d17332ce4..49053647a4 100644 --- a/modules/cratedb/go.mod +++ b/modules/cratedb/go.mod @@ -1,6 +1,6 @@ module github.com/testcontainers/testcontainers-go/modules/cratedb -go 1.25.0 +go 1.26.0 require ( github.com/stretchr/testify v1.11.1 diff --git a/modules/databend/go.mod b/modules/databend/go.mod index 19813d0d93..d41fe2d7b6 100644 --- a/modules/databend/go.mod +++ b/modules/databend/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/databend -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/datafuselabs/databend-go v0.7.0 diff --git a/modules/dex/go.mod b/modules/dex/go.mod index b484c830fa..97775ace13 100644 --- a/modules/dex/go.mod +++ b/modules/dex/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/dex -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/coreos/go-oidc/v3 v3.18.0 diff --git a/modules/dind/go.mod b/modules/dind/go.mod index 66ee24b192..bd390e55cf 100644 --- a/modules/dind/go.mod +++ b/modules/dind/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/dind -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/moby/moby/api v1.56.0 diff --git a/modules/dockermcpgateway/go.mod b/modules/dockermcpgateway/go.mod index 3fea9c3530..85c376af18 100644 --- a/modules/dockermcpgateway/go.mod +++ b/modules/dockermcpgateway/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/dockermcpgateway -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/moby/moby/api v1.56.0 diff --git a/modules/dockermcpgateway/options.go b/modules/dockermcpgateway/options.go index b9348f0601..7eca2578b4 100644 --- a/modules/dockermcpgateway/options.go +++ b/modules/dockermcpgateway/options.go @@ -21,7 +21,7 @@ func defaultOptions() options { } // Compiler check to ensure that Option implements the testcontainers.ContainerCustomizer interface. -var _ testcontainers.ContainerCustomizer = (Option)(nil) +var _ testcontainers.ContainerCustomizer = Option(nil) // Option is an option for the DockerMCPGateway container. type Option func(*options) error diff --git a/modules/dockermodelrunner/go.mod b/modules/dockermodelrunner/go.mod index d594de7d40..51d7aa58c8 100644 --- a/modules/dockermodelrunner/go.mod +++ b/modules/dockermodelrunner/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/dockermodelrunner -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/moby/moby/client v0.6.0 diff --git a/modules/dockermodelrunner/internal/sdk/client/pull.go b/modules/dockermodelrunner/internal/sdk/client/pull.go index 26e7cf035c..cffb1a0852 100644 --- a/modules/dockermodelrunner/internal/sdk/client/pull.go +++ b/modules/dockermodelrunner/internal/sdk/client/pull.go @@ -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 { diff --git a/modules/dockermodelrunner/options.go b/modules/dockermodelrunner/options.go index d5964ab487..5768095bd7 100644 --- a/modules/dockermodelrunner/options.go +++ b/modules/dockermodelrunner/options.go @@ -11,7 +11,7 @@ func defaultOptions() options { } // Compiler check to ensure that Option implements the testcontainers.ContainerCustomizer interface. -var _ testcontainers.ContainerCustomizer = (Option)(nil) +var _ testcontainers.ContainerCustomizer = Option(nil) // Option is an option for the DockerModelRunner container. type Option func(*options) error diff --git a/modules/dolt/go.mod b/modules/dolt/go.mod index 586baa8158..3ff0194fe4 100644 --- a/modules/dolt/go.mod +++ b/modules/dolt/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/dolt -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/go-sql-driver/mysql v1.7.1 diff --git a/modules/dynamodb/go.mod b/modules/dynamodb/go.mod index c0e0fd8c19..9949b8a771 100644 --- a/modules/dynamodb/go.mod +++ b/modules/dynamodb/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/dynamodb -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/aws/aws-sdk-go-v2 v1.31.0 diff --git a/modules/elasticsearch/go.mod b/modules/elasticsearch/go.mod index 806e89d9d8..cf6e4e6c48 100644 --- a/modules/elasticsearch/go.mod +++ b/modules/elasticsearch/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/elasticsearch -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/elastic/go-elasticsearch/v8 v8.12.1 diff --git a/modules/etcd/go.mod b/modules/etcd/go.mod index e5d3cd530b..a2d365f544 100644 --- a/modules/etcd/go.mod +++ b/modules/etcd/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/etcd -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/containerd/errdefs v1.0.0 diff --git a/modules/etcd/options.go b/modules/etcd/options.go index 837b747955..096d57f003 100644 --- a/modules/etcd/options.go +++ b/modules/etcd/options.go @@ -22,7 +22,7 @@ func defaultOptions() options { } // Compiler check to ensure that Option implements the testcontainers.ContainerCustomizer interface. -var _ testcontainers.ContainerCustomizer = (Option)(nil) +var _ testcontainers.ContainerCustomizer = Option(nil) // Option is an option for the Etcd container. type Option func(*options) error diff --git a/modules/fakegcsserver/go.mod b/modules/fakegcsserver/go.mod index 91625b845c..a27d7c84ac 100644 --- a/modules/fakegcsserver/go.mod +++ b/modules/fakegcsserver/go.mod @@ -1,6 +1,6 @@ module github.com/testcontainers/testcontainers-go/modules/fakegcsserver -go 1.25.0 +go 1.26.0 require ( github.com/stretchr/testify v1.11.1 diff --git a/modules/fakegcsserver/options.go b/modules/fakegcsserver/options.go index 63d9d260cd..d6719ee9be 100644 --- a/modules/fakegcsserver/options.go +++ b/modules/fakegcsserver/options.go @@ -21,7 +21,7 @@ func defaultOptions() options { } // Satisfy the testcontainers.ContainerCustomizer interface. -var _ testcontainers.ContainerCustomizer = (Option)(nil) +var _ testcontainers.ContainerCustomizer = Option(nil) // Option is an option for the FakeGCSServer container. type Option func(*options) error diff --git a/modules/firebird/go.mod b/modules/firebird/go.mod index 1be1ba2a77..d030b067f6 100644 --- a/modules/firebird/go.mod +++ b/modules/firebird/go.mod @@ -1,6 +1,6 @@ module github.com/testcontainers/testcontainers-go/modules/firebird -go 1.25.0 +go 1.26.0 require ( github.com/stretchr/testify v1.11.1 diff --git a/modules/forgejo/go.mod b/modules/forgejo/go.mod index d9ec2dc902..7879850bd3 100644 --- a/modules/forgejo/go.mod +++ b/modules/forgejo/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/forgejo -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/stretchr/testify v1.11.1 diff --git a/modules/gcloud/go.mod b/modules/gcloud/go.mod index 5339408ffe..ac3942f5fb 100644 --- a/modules/gcloud/go.mod +++ b/modules/gcloud/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/gcloud -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( cloud.google.com/go/bigquery v1.72.0 diff --git a/modules/grafana-lgtm/go.mod b/modules/grafana-lgtm/go.mod index 9aebceaeb8..74644ccc92 100644 --- a/modules/grafana-lgtm/go.mod +++ b/modules/grafana-lgtm/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/grafana-lgtm -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/stretchr/testify v1.11.1 diff --git a/modules/inbucket/go.mod b/modules/inbucket/go.mod index 94a319447e..4eff66e55d 100644 --- a/modules/inbucket/go.mod +++ b/modules/inbucket/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/inbucket -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/inbucket/inbucket v2.0.0+incompatible diff --git a/modules/influxdb/go.mod b/modules/influxdb/go.mod index 0af6a7d92a..667ab37051 100644 --- a/modules/influxdb/go.mod +++ b/modules/influxdb/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/influxdb -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/influxdata/influxdb-client-go/v2 v2.14.0 diff --git a/modules/k3s/go.mod b/modules/k3s/go.mod index 1e73897d87..09e48a1866 100644 --- a/modules/k3s/go.mod +++ b/modules/k3s/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/k3s -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/containerd/platforms v0.2.1 diff --git a/modules/k6/go.mod b/modules/k6/go.mod index 584e339b57..5f46802c51 100644 --- a/modules/k6/go.mod +++ b/modules/k6/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/k6 -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/moby/moby/api v1.56.0 diff --git a/modules/kafka/go.mod b/modules/kafka/go.mod index 37955426d7..66e4b411a6 100644 --- a/modules/kafka/go.mod +++ b/modules/kafka/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/kafka -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/IBM/sarama v1.42.1 diff --git a/modules/kurrentdb/go.mod b/modules/kurrentdb/go.mod index 9038d6b02b..b18a398fa5 100644 --- a/modules/kurrentdb/go.mod +++ b/modules/kurrentdb/go.mod @@ -1,6 +1,6 @@ module github.com/testcontainers/testcontainers-go/modules/kurrentdb -go 1.25.0 +go 1.26.0 require ( github.com/stretchr/testify v1.11.1 diff --git a/modules/localstack/go.mod b/modules/localstack/go.mod index b2f87daa08..c41c950dde 100644 --- a/modules/localstack/go.mod +++ b/modules/localstack/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/localstack -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/aws/aws-sdk-go v1.50.31 diff --git a/modules/mailpit/go.mod b/modules/mailpit/go.mod index d468fe38b7..70630e62c1 100644 --- a/modules/mailpit/go.mod +++ b/modules/mailpit/go.mod @@ -1,6 +1,6 @@ module github.com/testcontainers/testcontainers-go/modules/mailpit -go 1.25.0 +go 1.26.0 require ( github.com/stretchr/testify v1.11.1 diff --git a/modules/mariadb/go.mod b/modules/mariadb/go.mod index 1075222c6d..e1b7e85926 100644 --- a/modules/mariadb/go.mod +++ b/modules/mariadb/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/mariadb -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/go-sql-driver/mysql v1.7.1 diff --git a/modules/meilisearch/go.mod b/modules/meilisearch/go.mod index 04f6d9b8fc..724cc2c6fa 100644 --- a/modules/meilisearch/go.mod +++ b/modules/meilisearch/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/meilisearch -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/stretchr/testify v1.11.1 diff --git a/modules/memcached/go.mod b/modules/memcached/go.mod index 583b2a3cf4..25dd13cda2 100644 --- a/modules/memcached/go.mod +++ b/modules/memcached/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/memcached -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/bradfitz/gomemcache v0.0.0-20250403215159-8d39553ac7cf diff --git a/modules/milvus/go.mod b/modules/milvus/go.mod index b206250d83..04973f3d10 100644 --- a/modules/milvus/go.mod +++ b/modules/milvus/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/milvus -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/milvus-io/milvus/client/v2 v2.6.0 diff --git a/modules/minio/go.mod b/modules/minio/go.mod index a78a13ff36..39e96ec171 100644 --- a/modules/minio/go.mod +++ b/modules/minio/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/minio -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/minio/minio-go/v7 v7.0.68 diff --git a/modules/mockserver/go.mod b/modules/mockserver/go.mod index eadcadbe14..2405370400 100644 --- a/modules/mockserver/go.mod +++ b/modules/mockserver/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/mockserver -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/BraspagDevelopers/mock-server-client v0.2.2 diff --git a/modules/mongodb/atlaslocal/options.go b/modules/mongodb/atlaslocal/options.go index 3b6c92022e..d8e413f27f 100644 --- a/modules/mongodb/atlaslocal/options.go +++ b/modules/mongodb/atlaslocal/options.go @@ -24,7 +24,7 @@ const ( ) // Compiler check to ensure that Option implements the testcontainers.ContainerCustomizer interface. -var _ testcontainers.ContainerCustomizer = (Option)(nil) +var _ testcontainers.ContainerCustomizer = Option(nil) type options struct { username string diff --git a/modules/mongodb/go.mod b/modules/mongodb/go.mod index 1fc03dab27..f2d8fffc2e 100644 --- a/modules/mongodb/go.mod +++ b/modules/mongodb/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/mongodb -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/stretchr/testify v1.11.1 diff --git a/modules/mosquitto/go.mod b/modules/mosquitto/go.mod index 658b6c5dab..b1c18f4113 100644 --- a/modules/mosquitto/go.mod +++ b/modules/mosquitto/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/mosquitto -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/stretchr/testify v1.11.1 diff --git a/modules/mssql/go.mod b/modules/mssql/go.mod index 3320b65b2e..abcbbedddf 100644 --- a/modules/mssql/go.mod +++ b/modules/mssql/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/mssql -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/microsoft/go-mssqldb v1.7.0 diff --git a/modules/mysql/go.mod b/modules/mysql/go.mod index d9217d4669..86d9eeab0a 100644 --- a/modules/mysql/go.mod +++ b/modules/mysql/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/mysql -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/go-sql-driver/mysql v1.7.1 diff --git a/modules/nats/go.mod b/modules/nats/go.mod index 12a3b0f757..0a956e6d36 100644 --- a/modules/nats/go.mod +++ b/modules/nats/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/nats -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/nats-io/nats.go v1.33.1 diff --git a/modules/nebulagraph/go.mod b/modules/nebulagraph/go.mod index fa74fd5b71..7a0c8ab0e6 100644 --- a/modules/nebulagraph/go.mod +++ b/modules/nebulagraph/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/nebulagraph -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/jolestar/go-commons-pool v2.0.0+incompatible diff --git a/modules/neo4j/go.mod b/modules/neo4j/go.mod index 239eedab51..4d7382cb7c 100644 --- a/modules/neo4j/go.mod +++ b/modules/neo4j/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/neo4j -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/moby/moby/api v1.56.0 diff --git a/modules/nginx/go.mod b/modules/nginx/go.mod index 3629110691..af46b7c23b 100644 --- a/modules/nginx/go.mod +++ b/modules/nginx/go.mod @@ -1,6 +1,6 @@ module github.com/testcontainers/testcontainers-go/modules/nginx -go 1.25.0 +go 1.26.0 require ( github.com/stretchr/testify v1.11.1 diff --git a/modules/ollama/go.mod b/modules/ollama/go.mod index eda1914792..937daaafae 100644 --- a/modules/ollama/go.mod +++ b/modules/ollama/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/ollama -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/containerd/errdefs v1.0.0 diff --git a/modules/openfga/go.mod b/modules/openfga/go.mod index 118e5f9af7..5be12d7c78 100644 --- a/modules/openfga/go.mod +++ b/modules/openfga/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/openfga -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/openfga/go-sdk v0.3.5 diff --git a/modules/openfga/openfga.go b/modules/openfga/openfga.go index c49770fbaa..f35393271e 100644 --- a/modules/openfga/openfga.go +++ b/modules/openfga/openfga.go @@ -59,7 +59,7 @@ func Run(ctx context.Context, img string, opts ...testcontainers.ContainerCustom return false } - return (strings.Contains(string(bs), "SERVING")) + return strings.Contains(string(bs), "SERVING") }), ), ) diff --git a/modules/openldap/go.mod b/modules/openldap/go.mod index 8c0ca6a90c..228f9a384c 100644 --- a/modules/openldap/go.mod +++ b/modules/openldap/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/openldap -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/go-ldap/ldap/v3 v3.4.6 diff --git a/modules/opensearch/go.mod b/modules/opensearch/go.mod index 6f4d47fb97..3e772c36a6 100644 --- a/modules/opensearch/go.mod +++ b/modules/opensearch/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/opensearch -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/docker/go-units v0.5.0 diff --git a/modules/orientdb/go.mod b/modules/orientdb/go.mod index 0b949c2a22..509c2825e3 100644 --- a/modules/orientdb/go.mod +++ b/modules/orientdb/go.mod @@ -1,6 +1,6 @@ module github.com/testcontainers/testcontainers-go/modules/orientdb -go 1.25.0 +go 1.26.0 require ( github.com/stretchr/testify v1.11.1 diff --git a/modules/papercutsmtp/go.mod b/modules/papercutsmtp/go.mod index c7a3461125..3abc3c8005 100644 --- a/modules/papercutsmtp/go.mod +++ b/modules/papercutsmtp/go.mod @@ -1,6 +1,6 @@ module github.com/testcontainers/testcontainers-go/modules/papercutsmtp -go 1.25.0 +go 1.26.0 require ( github.com/stretchr/testify v1.11.1 diff --git a/modules/pinecone/go.mod b/modules/pinecone/go.mod index 695a522744..8c607bee0d 100644 --- a/modules/pinecone/go.mod +++ b/modules/pinecone/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/pinecone -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/pinecone-io/go-pinecone/v2 v2.2.0 diff --git a/modules/postgres/go.mod b/modules/postgres/go.mod index 5674b302cb..2556c1a55a 100644 --- a/modules/postgres/go.mod +++ b/modules/postgres/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/postgres -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/jackc/pgx/v5 v5.9.2 diff --git a/modules/postgres/options.go b/modules/postgres/options.go index 64d56cbdbb..10e2c9670c 100644 --- a/modules/postgres/options.go +++ b/modules/postgres/options.go @@ -18,7 +18,7 @@ func defaultOptions() options { } // Compiler check to ensure that Option implements the testcontainers.ContainerCustomizer interface. -var _ testcontainers.ContainerCustomizer = (Option)(nil) +var _ testcontainers.ContainerCustomizer = Option(nil) // Option is an option for the Postgres container. type Option func(*options) diff --git a/modules/presto/go.mod b/modules/presto/go.mod index 2eb0b0d39e..1b08dd7ee6 100644 --- a/modules/presto/go.mod +++ b/modules/presto/go.mod @@ -1,6 +1,6 @@ module github.com/testcontainers/testcontainers-go/modules/presto -go 1.25.0 +go 1.26.0 require ( github.com/stretchr/testify v1.11.1 diff --git a/modules/pulsar/go.mod b/modules/pulsar/go.mod index bd51b9c0d8..b970ed203f 100644 --- a/modules/pulsar/go.mod +++ b/modules/pulsar/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/pulsar -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/apache/pulsar-client-go v0.14.0 diff --git a/modules/qdrant/go.mod b/modules/qdrant/go.mod index 176e27e46d..dce8d49d96 100644 --- a/modules/qdrant/go.mod +++ b/modules/qdrant/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/qdrant -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/qdrant/go-client v1.7.0 diff --git a/modules/questdb/go.mod b/modules/questdb/go.mod index 5c83f1d0ba..5b744703b6 100644 --- a/modules/questdb/go.mod +++ b/modules/questdb/go.mod @@ -1,6 +1,6 @@ module github.com/testcontainers/testcontainers-go/modules/questdb -go 1.25.0 +go 1.26.0 require ( github.com/stretchr/testify v1.11.1 diff --git a/modules/rabbitmq/go.mod b/modules/rabbitmq/go.mod index cab554e273..447a2b0c83 100644 --- a/modules/rabbitmq/go.mod +++ b/modules/rabbitmq/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/rabbitmq -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/rabbitmq/amqp091-go v1.13.0 diff --git a/modules/ravendb/go.mod b/modules/ravendb/go.mod index 450f4e6933..64c7cef37c 100644 --- a/modules/ravendb/go.mod +++ b/modules/ravendb/go.mod @@ -1,6 +1,6 @@ module github.com/testcontainers/testcontainers-go/modules/ravendb -go 1.25.0 +go 1.26.0 require ( github.com/stretchr/testify v1.11.1 diff --git a/modules/redis/go.mod b/modules/redis/go.mod index dc4d925c84..feb409bbf1 100644 --- a/modules/redis/go.mod +++ b/modules/redis/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/redis -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/google/uuid v1.6.0 diff --git a/modules/redis/options.go b/modules/redis/options.go index 83af997bb4..61153af1c6 100644 --- a/modules/redis/options.go +++ b/modules/redis/options.go @@ -17,7 +17,7 @@ type options struct { } // Compiler check to ensure that Option implements the testcontainers.ContainerCustomizer interface. -var _ testcontainers.ContainerCustomizer = (Option)(nil) +var _ testcontainers.ContainerCustomizer = Option(nil) // Option is an option for the Redis container. type Option func(*options) error diff --git a/modules/redpanda/go.mod b/modules/redpanda/go.mod index 16f3ce4bdb..ec648e341a 100644 --- a/modules/redpanda/go.mod +++ b/modules/redpanda/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/redpanda -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/moby/moby/api v1.56.0 diff --git a/modules/redpanda/options.go b/modules/redpanda/options.go index 720e09c2fd..2d73f4f2fc 100644 --- a/modules/redpanda/options.go +++ b/modules/redpanda/options.go @@ -82,7 +82,7 @@ func defaultOptions() options { } // Compiler check to ensure that Option implements the testcontainers.ContainerCustomizer interface. -var _ testcontainers.ContainerCustomizer = (Option)(nil) +var _ testcontainers.ContainerCustomizer = Option(nil) // Option is an option for the Redpanda container. type Option func(*options) error diff --git a/modules/registry/go.mod b/modules/registry/go.mod index 7aa69bf3ae..a7043d9cc0 100644 --- a/modules/registry/go.mod +++ b/modules/registry/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/registry -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/containerd/platforms v0.2.1 diff --git a/modules/s3mock/go.mod b/modules/s3mock/go.mod index 213483847e..4fc59c2109 100644 --- a/modules/s3mock/go.mod +++ b/modules/s3mock/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/s3mock -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/aws/aws-sdk-go-v2 v1.42.1 diff --git a/modules/scylladb/go.mod b/modules/scylladb/go.mod index d52f096abb..0758a9fb9b 100644 --- a/modules/scylladb/go.mod +++ b/modules/scylladb/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/scylladb -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/aws/aws-sdk-go-v2 v1.42.1 diff --git a/modules/sftp/go.mod b/modules/sftp/go.mod index c30bb98bb9..723297d27c 100644 --- a/modules/sftp/go.mod +++ b/modules/sftp/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/sftp -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/stretchr/testify v1.11.1 diff --git a/modules/sftp/options.go b/modules/sftp/options.go index 87e64aca2b..ab5f89fbcd 100644 --- a/modules/sftp/options.go +++ b/modules/sftp/options.go @@ -19,7 +19,7 @@ func defaultOptions() *options { } // Compiler check to ensure that Option implements the testcontainers.ContainerCustomizer interface. -var _ testcontainers.ContainerCustomizer = (Option)(nil) +var _ testcontainers.ContainerCustomizer = Option(nil) // Option is an option for the SFTP container. type Option func(*options) diff --git a/modules/socat/go.mod b/modules/socat/go.mod index 7adcb19357..22d45a8d8c 100644 --- a/modules/socat/go.mod +++ b/modules/socat/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/socat -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/stretchr/testify v1.11.1 diff --git a/modules/socat/options.go b/modules/socat/options.go index 88a08e7adb..a49ff5b442 100644 --- a/modules/socat/options.go +++ b/modules/socat/options.go @@ -20,7 +20,7 @@ func defaultOptions() options { } // Compiler check to ensure that Option implements the testcontainers.ContainerCustomizer interface. -var _ testcontainers.ContainerCustomizer = (Option)(nil) +var _ testcontainers.ContainerCustomizer = Option(nil) // Option is an option for the Socat container. type Option func(*options) error diff --git a/modules/solace/go.mod b/modules/solace/go.mod index 9e697e99f7..074342a168 100644 --- a/modules/solace/go.mod +++ b/modules/solace/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/solace -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/docker/go-units v0.5.0 diff --git a/modules/solace/options.go b/modules/solace/options.go index 00823485bf..121ed2aac9 100644 --- a/modules/solace/options.go +++ b/modules/solace/options.go @@ -26,7 +26,7 @@ func defaultOptions() options { } // Compiler check to ensure that Option implements the testcontainers.ContainerCustomizer interface. -var _ testcontainers.ContainerCustomizer = (Option)(nil) +var _ testcontainers.ContainerCustomizer = Option(nil) // Option is an option for the Solace container. type Option func(*options) error diff --git a/modules/solr/go.mod b/modules/solr/go.mod index b2c8af0e98..6215b06e95 100644 --- a/modules/solr/go.mod +++ b/modules/solr/go.mod @@ -1,6 +1,6 @@ module github.com/testcontainers/testcontainers-go/modules/solr -go 1.25.0 +go 1.26.0 require ( github.com/stretchr/testify v1.11.1 diff --git a/modules/surrealdb/go.mod b/modules/surrealdb/go.mod index 72e70c333d..38cb49263b 100644 --- a/modules/surrealdb/go.mod +++ b/modules/surrealdb/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/surrealdb -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/stretchr/testify v1.11.1 diff --git a/modules/tidb/go.mod b/modules/tidb/go.mod index 701acc8141..bf312ade66 100644 --- a/modules/tidb/go.mod +++ b/modules/tidb/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/tidb -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/go-sql-driver/mysql v1.7.1 diff --git a/modules/timeplus/go.mod b/modules/timeplus/go.mod index 22950e835b..8b524568d7 100644 --- a/modules/timeplus/go.mod +++ b/modules/timeplus/go.mod @@ -1,6 +1,6 @@ module github.com/testcontainers/testcontainers-go/modules/timeplus -go 1.25.0 +go 1.26.0 require ( github.com/stretchr/testify v1.11.1 diff --git a/modules/toxiproxy/go.mod b/modules/toxiproxy/go.mod index 1a2c5e6cf8..2288a60e7a 100644 --- a/modules/toxiproxy/go.mod +++ b/modules/toxiproxy/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/toxiproxy -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/Shopify/toxiproxy/v2 v2.12.0 diff --git a/modules/toxiproxy/options.go b/modules/toxiproxy/options.go index 6b3d1db534..1d15c78fc3 100644 --- a/modules/toxiproxy/options.go +++ b/modules/toxiproxy/options.go @@ -19,7 +19,7 @@ func defaultOptions() options { } // Compiler check to ensure that Option implements the testcontainers.ContainerCustomizer interface. -var _ testcontainers.ContainerCustomizer = (Option)(nil) +var _ testcontainers.ContainerCustomizer = Option(nil) // Option is an option for the Toxiproxy container. type Option func(*options) error diff --git a/modules/trino/go.mod b/modules/trino/go.mod index 21df3d9334..e105e811a0 100644 --- a/modules/trino/go.mod +++ b/modules/trino/go.mod @@ -1,6 +1,6 @@ module github.com/testcontainers/testcontainers-go/modules/trino -go 1.25.0 +go 1.26.0 require ( github.com/stretchr/testify v1.11.1 diff --git a/modules/typesense/go.mod b/modules/typesense/go.mod index 2e4acd41aa..8f04a479e3 100644 --- a/modules/typesense/go.mod +++ b/modules/typesense/go.mod @@ -1,6 +1,6 @@ module github.com/testcontainers/testcontainers-go/modules/typesense -go 1.25.0 +go 1.26.0 require ( github.com/stretchr/testify v1.11.1 diff --git a/modules/valkey/go.mod b/modules/valkey/go.mod index dcc563f28a..916077ce34 100644 --- a/modules/valkey/go.mod +++ b/modules/valkey/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/valkey -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/google/uuid v1.6.0 diff --git a/modules/valkey/options.go b/modules/valkey/options.go index 639520e8ce..9f3596bcd5 100644 --- a/modules/valkey/options.go +++ b/modules/valkey/options.go @@ -16,7 +16,7 @@ type options struct { } // Compiler check to ensure that Option implements the testcontainers.ContainerCustomizer interface. -var _ testcontainers.ContainerCustomizer = (Option)(nil) +var _ testcontainers.ContainerCustomizer = Option(nil) // Option is an option for the Valkey container. type Option func(*options) error diff --git a/modules/vault/go.mod b/modules/vault/go.mod index 6e0ef04e96..b3a0074509 100644 --- a/modules/vault/go.mod +++ b/modules/vault/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/vault -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/hashicorp/vault-client-go v0.4.3 diff --git a/modules/vearch/go.mod b/modules/vearch/go.mod index 7ba60642ad..2703cf8400 100644 --- a/modules/vearch/go.mod +++ b/modules/vearch/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/vearch -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/moby/moby/api v1.56.0 diff --git a/modules/weaviate/go.mod b/modules/weaviate/go.mod index 4d7921713f..6174643307 100644 --- a/modules/weaviate/go.mod +++ b/modules/weaviate/go.mod @@ -1,6 +1,6 @@ module github.com/testcontainers/testcontainers-go/modules/weaviate -go 1.26 +go 1.26.0 require ( github.com/stretchr/testify v1.11.1 diff --git a/modules/yugabytedb/go.mod b/modules/yugabytedb/go.mod index 4a3370520d..eaa1845971 100644 --- a/modules/yugabytedb/go.mod +++ b/modules/yugabytedb/go.mod @@ -1,8 +1,8 @@ module github.com/testcontainers/testcontainers-go/modules/yugabytedb -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 require ( github.com/lib/pq v1.10.9 diff --git a/scripts/bump-go.sh b/scripts/bump-go.sh index 5d1c785f7d..82ee936351 100755 --- a/scripts/bump-go.sh +++ b/scripts/bump-go.sh @@ -1,21 +1,20 @@ #!/usr/bin/env bash -# This script is used to bump the version of Go in Testcontainers for Go, -# modifying the following files: -# - go.mod in the core module and submodules. -# - Markdown files explaining how to use Testcontainers for Go in the different CI systems. -# - Github action workflows using a test matrix to test Testcontainers for Go in different versions of Go. -# - Templates for the module generator. -# - Devcontainer file for VSCode. +# Bumps the minimal Go version (major.minor) across the project: +# - go.mod files: "go" and "toolchain" directives. +# - CI docs (docs/system_requirements/ci), workflows matrix, test Dockerfiles, devcontainer, AI.md. # -# By default, it will be run in dry-run mode, which will print the commands that would be executed, without actually -# executing them. +# Derived automatically: current version (root go.mod), next minor, latest patch releases +# (Go module proxy; override with GO_PATCH / GO_NEXT_PATCH) and the golang:X.Y-alpine digest +# (docker; override with GOLANG_IMAGE_DIGEST). # -# Usage: ./scripts/bump-go.sh "1.20" +# Dry-run by default, printing the commands: ./scripts/bump-go.sh "1.26" +# Apply the changes: DRY_RUN="false" ./scripts/bump-go.sh "1.26" # -# It's possible to run the script without dry-run mode actually executing the commands. -# -# Usage: DRY_RUN="false" ./scripts/bump-go.sh "1.20" +# Afterwards: run "make tidy-all", check golangci-lint supports the new Go version +# (commons-test.mk, .github/workflows/ci-lint-go.yml) and review Go checks in ci-test-go.yml. + +set -euo pipefail readonly CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" readonly DRY_RUN="${DRY_RUN:-true}" @@ -24,110 +23,201 @@ readonly GO_MOD_FILE="${ROOT_DIR}/go.mod" readonly DEVCONTAINER_IMAGE_PREFIX="go:" function main() { + local goVersion="${1:-}" + if [[ ! "${goVersion}" =~ ^[0-9]+\.[0-9]+$ ]]; then + echo "Usage: $0 (e.g. $0 1.26)" >&2 + exit 1 + fi + echo "Updating Go version:" local currentGoVersion="$(extractCurrentVersion)" + local currentMajorMinor="$(echo "${currentGoVersion}" | grep -oE '^[0-9]+\.[0-9]+')" echo " - Current: ${currentGoVersion}" - local escapedCurrentGoVersion="$(echo "${currentGoVersion}" | sed 's/\./\\./g')" - local goVersion="${1}" - local escapedGoVersion="$(echo "${goVersion}" | sed 's/\./\\./g')" + local nextGoVersion="${goVersion%.*}.$(( ${goVersion#*.} + 1 ))" echo " - New: ${goVersion}" + echo " - Next: ${nextGoVersion}" + + local goPatch="${GO_PATCH:-$(latestPatch "${goVersion}")}" + local goNextPatch="${GO_NEXT_PATCH:-$(latestPatch "${nextGoVersion}")}" + echo " - Latest patch releases: ${goPatch}, ${goNextPatch}" + + local imageDigest="${GOLANG_IMAGE_DIGEST:-$(golangImageDigest "${goVersion}")}" + echo " - golang:${goVersion}-alpine digest: ${imageDigest:-}" + + # all the files but go.mod reference the major.minor version, so the patterns use it + local escapedCurrentGoVersion="$(escape "${currentMajorMinor}")" + local escapedGoVersion="$(escape "${goVersion}")" # bump mod files in all the modules for modFile in $(find "${ROOT_DIR}" -name "go.mod" -not -path "${ROOT_DIR}/vendor/*" -not -path "${ROOT_DIR}/.git/*"); do - bumpModFile "${modFile}" "${escapedCurrentGoVersion}" "${escapedGoVersion}" + bumpModFile "${modFile}" "${escapedCurrentGoVersion}" "${goVersion}" "${goPatch}" done # bump markdown files - for f in $(find "${ROOT_DIR}" -name "*.md"); do - bumpGolangDockerImages "${f}" "${escapedCurrentGoVersion}" "${escapedGoVersion}" + for f in $(find "${ROOT_DIR}" -name "*.md" -not -path "${ROOT_DIR}/.git/*"); do + bumpGolangDockerImages "${f}" "${escapedCurrentGoVersion}" "${goVersion}" "${goPatch}" "${goNextPatch}" done # bump github action workflows for f in $(find "${ROOT_DIR}/.github/workflows" -name "*.yml"); do - bumpCIMatrix "${f}" "${escapedCurrentGoVersion}" "${escapedGoVersion}" + bumpCIMatrix "${f}" "${escapedCurrentGoVersion}" "${escapedGoVersion}" "${goVersion}" "${nextGoVersion}" + done + + # bump Dockerfiles used in tests + for f in $(find "${ROOT_DIR}" \( -name "Dockerfile" -o -name "*.Dockerfile" \) -not -path "${ROOT_DIR}/.git/*"); do + bumpTestDockerfile "${f}" "${goVersion}" "${imageDigest}" done # bump devcontainer file - bumpDevcontainer "${ROOT_DIR}/.devcontainer/devcontainer.json" "${escapedCurrentGoVersion}" "${escapedGoVersion}" + bumpDevcontainer "${ROOT_DIR}/.devcontainer/devcontainer.json" "${escapedCurrentGoVersion}" "${goVersion}" + + # bump the contributors guide for AI agents + bumpAIGuide "${ROOT_DIR}/AI.md" "${escapedCurrentGoVersion}" "${goPatch}" + + echo "" + echo "Done. Please run 'make tidy-all', and verify the golangci-lint version supports Go ${goVersion}." } -# it will replace the 'go-version: [${oldGoVersion}, 1.x]' with 'go-version: [${newGoVersion}, 1.x]' in the given file -function bumpCIMatrix() { +# escapes the dots of a version so it can be used in a sed regular expression. +function escape() { + echo "${1}" | sed 's/\./\\./g' +} + +# runs the given sed expression in-place on the given file, or prints it in dry-run mode. +function replace() { local file="${1}" - local oldGoVersion="${2}" - local newGoVersion="${3}" + shift + + if [[ ! -f "${file}" ]]; then + return + fi if [[ "${DRY_RUN}" == "true" ]]; then - echo "sed \"s/go-version: \[${oldGoVersion}/go-version: \[${newGoVersion}/g\" ${file} > ${file}.tmp" - echo "sed \"s/go-version: \\"${oldGoVersion}.x\"/go-version: \\"${newGoVersion}.x\"/g\" ${file}.tmp > ${file}.tmp" - echo "sed \"s/go-version == '\"${oldGoVersion}\.x\"'/go-version == '\"${newGoVersion}\.x\"'/g\" ${file}.tmp > ${file}.tmp" - echo "mv ${file}.tmp ${file}" + local expr + for expr in "$@"; do + echo "sed -E \"${expr}\" ${file} > ${file}.tmp && mv ${file}.tmp ${file}" + done else - sed "s/go-version: \[${oldGoVersion}/go-version: \[${newGoVersion}/g" ${file} > ${file}.tmp - mv ${file}.tmp ${file} - sed "s/go-version: \"${oldGoVersion}\.x\"/go-version: \"${newGoVersion}\.x\"/g" ${file} > ${file}.tmp - mv ${file}.tmp ${file} - sed "s/go-version == '\"${oldGoVersion}\.x\"'/go-version == '\"${newGoVersion}\.x\"'/g" ${file} > ${file}.tmp - mv ${file}.tmp ${file} + local expr + for expr in "$@"; do + sed -E "${expr}" "${file}" > "${file}.tmp" + mv "${file}.tmp" "${file}" + done fi } -# it will replace the 'go:0-${oldGoVersion}-bullseye' with 'go:0-${newGoVersion}-bullseye' in the given file +# it will replace the 'go-version: [${oldGoVersion}.x, ${newGoVersion}.x]' with +# 'go-version: [${newGoVersion}.x, ${nextGoVersion}.x]' in the given file, +# and the references to the lowest version in the matrix, used to decide if Sonar must be run. +function bumpCIMatrix() { + local file="${1}" + local oldGoVersion="${2}" + local escapedNewGoVersion="${3}" + local newGoVersion="${4}" + local nextGoVersion="${5}" + + replace "${file}" \ + "s/go-version: \[${oldGoVersion}\.x, ${escapedNewGoVersion}\.x\]/go-version: [${newGoVersion}.x, ${nextGoVersion}.x]/g" \ + "s/go-version: \[${oldGoVersion}\.x, 1\.x\]/go-version: [${newGoVersion}.x, 1.x]/g" \ + "s/go-version: \"${oldGoVersion}\.x\"/go-version: \"${newGoVersion}.x\"/g" \ + "s/\"${oldGoVersion}\.x\" ==/\"${newGoVersion}.x\" ==/g" \ + "s/go-version == '\"${oldGoVersion}\.x\"'/go-version == '\"${newGoVersion}.x\"'/g" +} + +# it will replace the 'go:${oldGoVersion}-trixie' with 'go:${newGoVersion}-trixie' in the given file function bumpDevcontainer() { local file="${1}" local oldGoVersion="${2}" local newGoVersion="${3}" - if [[ "${DRY_RUN}" == "true" ]]; then - echo "sed \"s/${DEVCONTAINER_IMAGE_PREFIX}${oldGoVersion}/${DEVCONTAINER_IMAGE_PREFIX}${newGoVersion}/g\" ${file} > ${file}.tmp" - echo "mv ${file}.tmp ${file}" - else - sed "s/${DEVCONTAINER_IMAGE_PREFIX}${oldGoVersion}/${DEVCONTAINER_IMAGE_PREFIX}${newGoVersion}/g" ${file} > ${file}.tmp - mv ${file}.tmp ${file} - fi + replace "${file}" "s/${DEVCONTAINER_IMAGE_PREFIX}${oldGoVersion}-/${DEVCONTAINER_IMAGE_PREFIX}${newGoVersion}-/g" } -# it will replace the 'golang:${oldGoVersion}' with 'golang:${newGoVersion}' in the given file +# it will replace the 'golang:${oldGoVersion}' with 'golang:${newGoVersion}' in the given file, +# plus the YAML variants used by the different CI systems, and the explicit patch versions used by CircleCI. function bumpGolangDockerImages() { local file="${1}" local oldGoVersion="${2}" local newGoVersion="${3}" + local goPatch="${4}" + local goNextPatch="${5}" + + replace "${file}" \ + "s/golang:${oldGoVersion}([^0-9.]|$)/golang:${newGoVersion}\1/g" \ + "s/golang: ${oldGoVersion}([^0-9.]|$)/golang: ${newGoVersion}\1/g" \ + "s/- \"${oldGoVersion}\"/- \"${newGoVersion}\"/g" \ + "s/(minimal version of Go required to use this module is )\*\*[0-9]+\.[0-9]+\*\*/\1**${newGoVersion}**/g" \ + "s/\[\"${oldGoVersion}\.[0-9]+\", \"[0-9]+\.[0-9]+\.[0-9]+\"\]/[\"${goPatch}\", \"${goNextPatch}\"]/g" +} - if [[ "${DRY_RUN}" == "true" ]]; then - echo "sed \"s/golang:${oldGoVersion}/golang:${newGoVersion}/g\" ${file} > ${file}.tmp" - echo "sed \"s/golang: ${oldGoVersion}/golang: ${newGoVersion}/g\" ${file}.tmp > ${file}.tmp" - echo "sed \"s/- \\"${oldGoVersion}\\"/- \\"${newGoVersion}\\"/g\" ${file}.tmp > ${file}.tmp" - echo "mv ${file}.tmp ${file}" +# it will replace the 'golang:X.Y-alpine@sha256:...' with 'golang:${newGoVersion}-alpine@sha256:${digest}' in the given file. +# If the digest could not be resolved, only the tag is updated and the digest must be refreshed manually. +function bumpTestDockerfile() { + local file="${1}" + local newGoVersion="${2}" + local digest="${3}" + + if ! grep -qE "^FROM golang:[0-9]+\.[0-9]+-alpine" "${file}"; then + return + fi + + if [[ -n "${digest}" ]]; then + replace "${file}" "s/^FROM golang:[0-9]+\.[0-9]+-alpine@sha256:[0-9a-f]+/FROM golang:${newGoVersion}-alpine@${digest}/" else - sed "s/golang:${oldGoVersion}/golang:${newGoVersion}/g" ${file} > ${file}.tmp - mv ${file}.tmp ${file} - sed "s/golang: ${oldGoVersion}/golang: ${newGoVersion}/g" ${file} > ${file}.tmp - mv ${file}.tmp ${file} - sed "s/- \"${oldGoVersion}\"/- \"${newGoVersion}\"/g" ${file} > ${file}.tmp - mv ${file}.tmp ${file} + echo "WARN: could not resolve the digest for golang:${newGoVersion}-alpine, please update it manually in ${file}" >&2 + replace "${file}" "s/^FROM golang:[0-9]+\.[0-9]+-alpine/FROM golang:${newGoVersion}-alpine/" fi } -# it will replace the 'go ${oldGoVersion}' with 'go ${newGoVersion}' in the given go.mod file +# it will replace the 'go ${oldGoVersion}[.N]' with 'go ${newGoVersion}.0' and the 'toolchain go${oldGoVersion}.N' +# with 'toolchain go${goPatch}' in the given go.mod file, where oldGoVersion is major.minor. Submodules pinned to +# a patch release of the old version (e.g. 'go 1.25.7') are bumped as well. function bumpModFile() { local goModFile="${1}" local oldGoVersion="${2}" local newGoVersion="${3}" + local goPatch="${4}" - if [[ "${DRY_RUN}" == "true" ]]; then - echo "sed \"s/^go ${oldGoVersion}/go ${newGoVersion}/g\" ${goModFile} > ${goModFile}.tmp" - echo "mv ${goModFile}.tmp ${goModFile}" - else - sed "s/^go ${oldGoVersion}/go ${newGoVersion}/g" ${goModFile} > ${goModFile}.tmp - mv ${goModFile}.tmp ${goModFile} - fi + replace "${goModFile}" \ + "s/^go ${oldGoVersion}(\.[0-9]+)?$/go ${newGoVersion}.0/" \ + "s/^toolchain go${oldGoVersion}\.[0-9]+$/toolchain go${goPatch}/" +} + +# it will replace the Go version used by the contributors in the AI guide, in the form 'Go 1.25.9' or 'gvm 1.25.9'. +function bumpAIGuide() { + local file="${1}" + local oldGoVersion="${2}" + local goPatch="${3}" + + replace "${file}" "s/(Go|gvm) ${oldGoVersion}\.[0-9]+/\1 ${goPatch}/g" } -# This function reads the reaper.go file and extracts the current version. +# This function reads the root go.mod file and extracts the current version. function extractCurrentVersion() { - cat "${GO_MOD_FILE}" | grep '^go .*' | sed 's/^go //g' | head -n 1 + grep '^go .*' "${GO_MOD_FILE}" | sed 's/^go //g' | head -n 1 +} + +# This function returns the latest patch release of the given major.minor Go version, using the Go module proxy. +function latestPatch() { + local majorMinor="${1}" + + local latest + latest="$(go list -m -versions go 2>/dev/null | tr ' ' '\n' | grep -E "^${majorMinor//./\\.}\.[0-9]+$" | tail -n 1 || true)" + if [[ -z "${latest}" ]]; then + echo "WARN: could not resolve the latest patch release of Go ${majorMinor}, using ${majorMinor}.0" >&2 + latest="${majorMinor}.0" + fi + + echo "${latest}" +} + +# This function returns the digest of the golang:X.Y-alpine multi-platform image, using docker. +function golangImageDigest() { + local majorMinor="${1}" + + docker buildx imagetools inspect "golang:${majorMinor}-alpine" 2>/dev/null | grep -m1 '^Digest:' | awk '{print $2}' || true } main "$@" diff --git a/testdata/args.Dockerfile b/testdata/args.Dockerfile index 2fd0969586..61cc426a4c 100644 --- a/testdata/args.Dockerfile +++ b/testdata/args.Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.24-alpine@sha256:fc2cff6625f3c1c92e6c85938ac5bd09034ad0d4bc2dfb08278020b68540dbb5 +FROM golang:1.26-alpine@sha256:8ac98ca534ac3f51e1f420a1dd2c15e74c75cfa0f23f3ad27eb5d7236c349a0c ARG FOO diff --git a/testdata/echoserver.Dockerfile b/testdata/echoserver.Dockerfile index 98a34199d9..79d54a8e0d 100644 --- a/testdata/echoserver.Dockerfile +++ b/testdata/echoserver.Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.24-alpine@sha256:fc2cff6625f3c1c92e6c85938ac5bd09034ad0d4bc2dfb08278020b68540dbb5 +FROM golang:1.26-alpine@sha256:8ac98ca534ac3f51e1f420a1dd2c15e74c75cfa0f23f3ad27eb5d7236c349a0c WORKDIR /app diff --git a/usage-metrics/go.mod b/usage-metrics/go.mod index f39262ac93..c791d43389 100644 --- a/usage-metrics/go.mod +++ b/usage-metrics/go.mod @@ -1,5 +1,5 @@ module github.com/testcontainers/testcontainers-go/usage-metrics -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8 diff --git a/wait/http.go b/wait/http.go index 95208290c8..28a1a71712 100644 --- a/wait/http.go +++ b/wait/http.go @@ -268,7 +268,6 @@ func (ws *HTTPStrategy) WaitUntilReady(ctx context.Context, target StrategyTarge DialContext: (&net.Dialer{ Timeout: time.Second, KeepAlive: 30 * time.Second, - DualStack: true, }).DialContext, ForceAttemptHTTP2: true, MaxIdleConns: 100, diff --git a/wait/log_test.go b/wait/log_test.go index 9dbe192227..00c3193f03 100644 --- a/wait/log_test.go +++ b/wait/log_test.go @@ -272,5 +272,5 @@ func TestWaitForLogFailsDueToUnexpectedContainerStatus(t *testing.T) { // readCloser returns an io.ReadCloser that reads from s. func readCloser(s string) io.ReadCloser { - return io.NopCloser(strings.NewReader((s))) + return io.NopCloser(strings.NewReader(s)) } diff --git a/wait/testdata/http/Dockerfile b/wait/testdata/http/Dockerfile index a06e74b2b3..882a3d8af6 100644 --- a/wait/testdata/http/Dockerfile +++ b/wait/testdata/http/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.25-alpine@sha256:8e02eb337d9e0ea459e041f1ee5eece41cbb61f1d83e7d883a3e2fb4862063fa as builder +FROM golang:1.26-alpine@sha256:8ac98ca534ac3f51e1f420a1dd2c15e74c75cfa0f23f3ad27eb5d7236c349a0c as builder WORKDIR /app COPY . . RUN mkdir -p dist diff --git a/wait/testdata/http/go.mod b/wait/testdata/http/go.mod index 221e4fc414..11c8e5918d 100644 --- a/wait/testdata/http/go.mod +++ b/wait/testdata/http/go.mod @@ -1,5 +1,5 @@ module httptest -go 1.25.0 +go 1.26.0 -toolchain go1.25.9 +toolchain go1.26.8