Skip to content

Commit 751c372

Browse files
committed
docs(version-pinning): correct subpath guidance after smoke-test
Tested both flows in scratch modules: - go get of a subpath (terratest/modules/terraform@v0.51.0) succeeds and resolves to the root module pin. - go mod edit -require of the same subpath fails on tidy with "unknown revision modules/terraform/v0.51.0", which is what the customer hit in #1615. Reframe the second section so the warning targets the actual foot-gun (hand-written subpath requires) rather than claiming subpaths are always broken.
1 parent 778e7d2 commit 751c372

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs/_docs/01_getting-started/version-pinning.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ go mod tidy
2222

2323
Replace `v0.56.0` with the tag you want from the [Releases page](https://github.com/gruntwork-io/terratest/releases). The same command upgrades, downgrades, or reverts the pin. Always commit `go.mod` and `go.sum` so the pin travels with your code; avoid `@latest` if you need reproducibility.
2424

25-
## Use the root module path
25+
## Use `go get`, not subpath requires
2626

27-
Pin `github.com/gruntwork-io/terratest`, not submodule paths like `github.com/gruntwork-io/terratest/modules/terraform`. Terratest publishes a single Go module at the repository root, so submodule-style versions (e.g. `modules/terraform/v0.51.0`) fail with `unknown revision`. Subpackage imports in your test code are fine; they all resolve through the root module pin.
27+
`go get github.com/gruntwork-io/terratest@<tag>` is enough; the pin applies to every subpackage your tests import. Avoid writing subpath requires by hand (e.g. `go mod edit -require github.com/gruntwork-io/terratest/modules/terraform@<tag>`); Go searches for a `modules/terraform/<tag>` tag and fails with `unknown revision`.

0 commit comments

Comments
 (0)