Skip to content

Commit 6ee7f6a

Browse files
authored
docs: improve consistency and fix typos (#534)
* docs: improve consistency and fix typos * docs: standardize pkg name * docs: standardize Testcontainers org naming * docs: fix word typo
1 parent 53dbf4d commit 6ee7f6a

File tree

10 files changed

+31
-31
lines changed

10 files changed

+31
-31
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[![Go Report Card](https://goreportcard.com/badge/github.com/testcontainers/testcontainers-go)](https://goreportcard.com/report/github.com/testcontainers/testcontainers-go)
33
[![GoDoc Reference](https://camo.githubusercontent.com/8609cfcb531fa0f5598a3d4353596fae9336cce3/68747470733a2f2f676f646f632e6f72672f6769746875622e636f6d2f79616e6777656e6d61692f686f772d746f2d6164642d62616467652d696e2d6769746875622d726561646d653f7374617475732e737667)](https://pkg.go.dev/github.com/testcontainers/testcontainers-go)
44

5-
Testcontainers-Go is a Go package that makes it simple to create and clean up container-based dependencies for
5+
Testcontainers-go is a Go package that makes it simple to create and clean up container-based dependencies for
66
automated integration/smoke tests. The clean, easy-to-use API enables developers to programmatically define containers
77
that should be run as part of a test and clean up those resources when the test is done.
88

@@ -82,5 +82,5 @@ Cleaning up your environment after test completion should be accomplished by def
8282

8383
## Documentation
8484

85-
More information about TestContainers-Go can be found in [./docs](./docs), which is rendered at
85+
More information about Testcontainers-go can be found in [./docs](./docs), which is rendered at
8686
[golang.testcontainers.org](https://golang.testcontainers.org).

docs/contributing_docs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing to documentation
22

3-
The testcontainers-go documentation is a static site built with [MkDocs](https://www.mkdocs.org/).
3+
The Testcontainers-go documentation is a static site built with [MkDocs](https://www.mkdocs.org/).
44
We use the [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/) theme, which offers a number of useful extensions to MkDocs.
55

66
In addition we use a [custom plugin](https://github.com/rnorth/mkdocs-codeinclude-plugin) for inclusion of code snippets.

docs/features/build_from_dockerfile.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ req := ContainerRequest{
4040
## Dynamic Build Context
4141

4242
If you would like to send a build context that you created in code (maybe you have a dynamic Dockerfile), you can
43-
send the build context as an `io.Reader` since the Docker Daemon accepts is as a tar file, you can use the [tar](https://golang.org/pkg/archive/tar/) package to create your context.
43+
send the build context as an `io.Reader` since the Docker Daemon accepts it as a tar file, you can use the [tar](https://golang.org/pkg/archive/tar/) package to create your context.
4444

4545

4646
To do this you would use the `ContextArchive` attribute in the `FromDockerfile` struct.
@@ -58,5 +58,5 @@ fromDockerfile := testcontainers.FromDockerfile{
5858
}
5959
```
6060

61-
**Please Note** if you specify a `ContextArchive` this will cause testcontainers to ignore the path passed
62-
in to `Context`
61+
**Please Note** if you specify a `ContextArchive` this will cause Testcontainers-go to ignore the path passed
62+
in to `Context`.

docs/features/copy_file.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ nginxC, err := GenericContainer(ctx, GenericContainerRequest{
1717
nginxC.CopyFileToContainer(ctx, "./testresources/hello.sh", "/hello_copy.sh", 700)
1818
```
1919

20-
Or you can add a list of files in ContainerRequest's struct, which can be copied before the container started:
20+
Or you can add a list of files in the `ContainerRequest` initialization, which can be copied before the container starts:
2121

2222
```go
2323
ctx := context.Background()
@@ -45,7 +45,7 @@ It's also possible to copy an entire directory to a container, and that can happ
4545

4646
It's important to notice that, when copying the directory to the container, the container path must exist in the Docker image. And this is a strong requirement for files to be copied _before_ the container is started, as we cannot create the full path at that time.
4747

48-
Once we understood that, there are two ways to copy directories to a container. The first one is using the existing `CopyFileToContainer` method, which will internally check if the host path is a directory, internally calling the new `CopyDirToContainer` method if needed:
48+
There are two ways to copy directories to a container. The first way uses the existing `CopyFileToContainer` method, which will internally check if the host path is a directory, internally calling the new `CopyDirToContainer` method if needed:
4949

5050
```go
5151
ctx := context.Background()
@@ -79,7 +79,7 @@ if err != nil {
7979
}
8080
```
8181

82-
And the second way is using the `CopyDirToContainer` method which, as you probably know, needs the existence of the parent directory where to copy the directory:
82+
And the second way uses the `CopyDirToContainer` method which, as you probably know, needs the existence of the parent directory in order to copy the directory:
8383

8484
```go
8585
ctx := context.Background()

docs/features/docker_compose.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This is intended to be useful on projects where Docker Compose is already used
77
in dev or other environments to define services that an application may be
88
dependent upon.
99

10-
You can override Testcontainers' default behaviour and make it use a
10+
You can override Testcontainers-go's default behaviour and make it use a
1111
docker-compose binary installed on the local machine. This will generally yield
1212
an experience that is closer to running docker-compose locally, with the caveat
1313
that Docker Compose needs to be present on dev and CI machines.
@@ -34,9 +34,9 @@ return nil
3434
```
3535

3636
Note that the environment variables in the `env` map will be applied, if
37-
possible, to the existing variables declared in the docker compose file.
37+
possible, to the existing variables declared in the Docker Compose file.
3838

39-
In the following example, we demonstrate how to stop a Docker compose using the
39+
In the following example, we demonstrate how to stop a Docker Compose created project using the
4040
convenient `Down` method.
4141

4242
```go

docs/features/garbage_collector.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Containers can be unused because:
1313
## Terminate function
1414

1515
As we saw previously there are at least two ways to remove unused containers.
16-
The primary method is to use the `Terminate(context.Conext)` function that is
16+
The primary method is to use the `Terminate(context.Context)` function that is
1717
available when a container is created. Use `defer` to ensure that it is called
1818
on test completion.
1919

@@ -27,8 +27,8 @@ on test completion.
2727

2828
[Ryuk](https://github.com/testcontainers/moby-ryuk) (also referred to as
2929
`Reaper` in this package) removes containers/networks/volumes created by
30-
Testcontainers-Go after a specified delay. It is a project developed by the
31-
TestContainers organization and is used across the board for many of the
30+
Testcontainers-go after a specified delay. It is a project developed by the
31+
Testcontainers organization and is used across the board for many of the
3232
different language implementations.
3333

3434
When you run one test, you will see an additional container called `ryuk`
@@ -39,7 +39,7 @@ for more than 10 seconds, it will be killed.
3939

4040
!!!tip
4141

42-
This feature can be disabled when creating a container
42+
This feature can be disabled when creating a container.
4343

4444
Even if you do not call Terminate, Ryuk ensures that the environment will be
4545
kept clean and even cleans itself when there is nothing left to do.

docs/features/using_podman.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Using Podman instead of Docker
22

3-
Testcontainers supports to use Podman (rootless or rootful) instead of Docker.
3+
Testcontainers-go supports the use of Podman (rootless or rootful) instead of Docker.
44
In most scenarios no special setup is required.
5-
Testcontainers will automatically discover the socket based on the `DOCKER_HOST` or the `TC_HOST` environment variables.
6-
Alternatively you can also configure the host with a `.testcontainers.properties` file.
5+
Testcontainers-go will automatically discover the socket based on the `DOCKER_HOST` or the `TC_HOST` environment variables.
6+
Alternatively you can configure the host with a `.testcontainers.properties` file.
77
The discovered Docker host is also taken into account when starting a reaper container.
88

99
There's currently only one special case where additional configuration is necessary: complex container network scenarios.
1010

11-
By default Testcontainers takes advantage of the default network settings both Docker and Podman are applying to newly created containers.
11+
By default Testcontainers-go takes advantage of the default network settings both Docker and Podman are applying to newly created containers.
1212
It only intervenes in scenarios where a `ContainerRequest` specifies networks and does not include the default network of the current container provider.
1313
Unfortunately the default network for Docker is called _bridge_ where the default network in Podman is called _podman_.
1414
It is not even possible to create a network called _bridge_ with Podman as Podman does not allow creating a network with the same name as an already existing network mode.

docs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Testcontainers-Go
1+
# Testcontainers-go
22

33
![Testcontainers logo](./logo.png)
44

55
## About
66

7-
Testcontainers-Go is a Go package that makes it simple to create and clean up container-based dependencies for
7+
Testcontainers-go is a Go package that makes it simple to create and clean up container-based dependencies for
88
automated integration/smoke tests. The clean, easy-to-use API enables developers to programmatically define containers
99
that should be run as part of a test and clean up those resources when the test is done.
1010

docs/quickstart/gotest.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
TestContainers plays well with the native `go test` framework.
1+
Testcontainers-go plays well with the native `go test` framework.
22

33
The ideal use case is for integration or end to end tests. It helps you to spin
44
up and manage the dependencies life cycle via Docker.
@@ -42,19 +42,19 @@ func TestWithRedis(t *testing.T) {
4242
The `testcontainers.ContainerRequest` describes how the Docker container will
4343
look.
4444

45-
* `Image` is the docker image the container starts from.
46-
* `ExposedPorts` lists the ports to be exposed from the container
45+
* `Image` is the Docker image the container starts from.
46+
* `ExposedPorts` lists the ports to be exposed from the container.
4747
* `WaitingFor` is a field you can use to validate when a container is ready. It
4848
is important to get this set because it helps to know when the container is
49-
ready to receive any traffic. In this, case we check for the logs we know come
49+
ready to receive any traffic. In this case, we check for the logs we know come
5050
from Redis, telling us that it is ready to accept requests.
5151

5252
When you use `ExposedPorts` you have to imagine yourself using `docker run -p
5353
<port>`. When you do so, `dockerd` maps the selected `<port>` from inside the
5454
container to a random one available on your host.
5555

5656
In the previous example, we expose `6379` for `tcp` traffic to the outside. This
57-
allows Redis to be reachable from your code that runs outside the container but
57+
allows Redis to be reachable from your code that runs outside the container, but
5858
it also makes parallelization possible because if you add `t.Parallel` to your
5959
tests, and each of them starts a Redis container each of them will be exposed on a
6060
different random port.
@@ -70,12 +70,12 @@ terminated function: `defer redisC.Terminate(ctx)`.
7070

7171
!!!tip
7272

73-
Look at [features/garbage_collector](/features/garbage_collector/) to know the another way you have to
74-
clean up.
73+
Look at [features/garbage_collector](/features/garbage_collector/) to know another way to
74+
clean up resources.
7575

7676
## 3. Make your code to talk with the container
7777

78-
This is just an example, but usually Go applications that relay on Redis are
78+
This is just an example, but usually Go applications that rely on Redis are
7979
using the [redis-go](https://github.com/go-redis/redis) client. This code gets
8080
the endpoint from the container we just started, and it configures the client.
8181

testing.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
// SkipIfProviderIsNotHealthy is a utility function capable of skipping tests
99
// if the provider is not healthy, or running at all.
1010
// This is a function designed to be used in your test, when Docker is not mandatory for CI/CD.
11-
// In this way tests that depend on testcontainers won't run if the provider is provisioned correctly.
11+
// In this way tests that depend on Testcontainers won't run if the provider is provisioned correctly.
1212
func SkipIfProviderIsNotHealthy(t *testing.T) {
1313
ctx := context.Background()
1414
provider, err := ProviderDocker.GetProvider()

0 commit comments

Comments
 (0)