-
-
Notifications
You must be signed in to change notification settings - Fork 500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: always generate the examples including a explicit image #1611
Conversation
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Specially for the interest of @eddumelendez 😉 |
* main: chore: always generate the examples including a explicit image (testcontainers#1611) chore: support linting all modules locally (testcontainers#1609)
* main: chore: always generate the examples including a explicit image (testcontainers#1611)
…containerd-1.7.5 * main: chore: always generate the examples including a explicit image (#1611) chore: support linting all modules locally (#1609) ci(sonarcloud): run only when not root-less (#1608) remove extra equal in sonar.organization (#1607) chore(ci): enable code coverage on Sonarcloud (#1518) docs: use Go testable examples in modules (#1603)
* main: chore: always generate the examples including a explicit image (testcontainers#1611) chore: support linting all modules locally (testcontainers#1609) ci(sonarcloud): run only when not root-less (testcontainers#1608) remove extra equal in sonar.organization (testcontainers#1607) chore(ci): enable code coverage on Sonarcloud (testcontainers#1518) docs: use Go testable examples in modules (testcontainers#1603) ci(lint): enable errorlint linter (testcontainers#1604) ci(lint): enable gocritic linter (testcontainers#1605) chore(deps): bump github.com/hashicorp/vault-client-go in /modules/vault (testcontainers#1566) ci(security): setup codeql scan (testcontainers#1606) chore(deps): bump github.com/cyphar/filepath-securejoin (testcontainers#1601) chore: generate Go examples for new modules (testcontainers#1600) chore: generate Go examples for new modules (testcontainers#1600)
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/testcontainers/testcontainers-go" | ||
"github.com/testcontainers/testcontainers-go/modules/{{ $lower }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @mdelapenya,
This is breaking go mod tidy when applied on an example.
go run . new example --name questdb --image "questdb/questdb:latest" --title QuestDB
Error: >> error synchronizing the dependencies: exit status 1
When you then try in examples/questdb
go mod tidy
go: finding module for package github.com/testcontainers/testcontainers-go/modules/questdb
github.com/testcontainers/testcontainers-go/examples/questdb tested by
github.com/testcontainers/testcontainers-go/examples/questdb.test imports
github.com/testcontainers/testcontainers-go/modules/questdb: module github.com/testcontainers/testcontainers-go@latest found (v0.23.0, replaced by ../..), but does not contain package github.com/testcon
tainers/testcontainers-go/modules/questdb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh you're right, the modules
keyword must be taken from the struct's parentDir 🤦
Will submit a fix ASAP, thanks for reporting it
What does this PR do?
This PR updates the module templates to always include the default image for the new module. It applies to:
Therefore, the all
RunContainer
calls in the examples will include thetestcontainers.WithImage("foo:bar")
functional option.Why is it important?
Users copy&pasting our code examples will receive a code snippet including the image, which is important for awareness of what version of the technology they are using.