diff --git a/docs/features/common_functional_options.md b/docs/features/common_functional_options.md index 288093941c..1572bb461b 100644 --- a/docs/features/common_functional_options.md +++ b/docs/features/common_functional_options.md @@ -22,7 +22,7 @@ Using the `WithImageSubstitutors` options, you could define your own substitutio If you need to either pass additional environment variables to a container or override them, you can use `testcontainers.WithEnv` for example: ```golang -postgres, err = postgresModule.RunContainer(ctx, testcontainers.WithEnv(map[string]string{"POSTGRES_INITDB_ARGS", "--no-sync"})) +postgres, err = postgresModule.RunContainer(ctx, testcontainers.WithEnv(map[string]string{"POSTGRES_INITDB_ARGS": "--no-sync"})) ``` #### WithLogConsumers diff --git a/modules/neo4j/config.go b/modules/neo4j/config.go index 9d0bc70816..1b62363cb9 100644 --- a/modules/neo4j/config.go +++ b/modules/neo4j/config.go @@ -123,9 +123,9 @@ func formatNeo4jConfig(name string) string { // the commercial licence agreement of Neo4j Enterprise Edition. The license // agreement is available at https://neo4j.com/terms/licensing/. func WithAcceptCommercialLicenseAgreement() testcontainers.CustomizeRequestOption { - return func(req *testcontainers.GenericContainerRequest) { - req.Env["NEO4J_ACCEPT_LICENSE_AGREEMENT"] = "yes" - } + return testcontainers.WithEnv(map[string]string{ + "NEO4J_ACCEPT_LICENSE_AGREEMENT": "yes", + }) } // WithAcceptEvaluationLicenseAgreement sets the environment variable @@ -134,7 +134,7 @@ func WithAcceptCommercialLicenseAgreement() testcontainers.CustomizeRequestOptio // agreement is available at https://neo4j.com/terms/enterprise_us/. Please // read the terms of the evaluation agreement before you accept. func WithAcceptEvaluationLicenseAgreement() testcontainers.CustomizeRequestOption { - return func(req *testcontainers.GenericContainerRequest) { - req.Env["NEO4J_ACCEPT_LICENSE_AGREEMENT"] = "eval" - } + return testcontainers.WithEnv(map[string]string{ + "NEO4J_ACCEPT_LICENSE_AGREEMENT": "eval", + }) }