Skip to content
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

Move analysis testing to Go module support #307

Merged
merged 3 commits into from
May 19, 2024
Merged

Conversation

bflad
Copy link
Owner

@bflad bflad commented May 19, 2024

Reference: golang/go#37054

When this Go module was under heavy development, the analysis testing framework in golang.org/x/tools only supported GOPATH based resolution. Subsequently, dependencies were vendored and a vendor symlink was placed in each of the test case directories.

With recent versions of golang.org/x/tools, placing a go.mod in the testdata directory will cause the analysis testing framework to enable Go module support. Only minor import and pathing changes are needed to convert over. Consumers will no longer be burdened with Go module dependencies only needed for testing this Go module.

Reference: golang/go#37054

When this Go module was under heavy development, the analysis testing framework in `golang.org/x/tools` only supported `GOPATH` based resolution. Subsequently, dependencies were vendored and a `vendor` symlink was placed in each of the test case directories.

With recent versions of `golang.org/x/tools`, placing a `go.mod` in the `testdata` directory will cause the analysis testing framework to enable Go module support. Only minor import and pathing changes are needed to convert over. Consumers will no longer be burdened with Go module dependencies only needed for testing this Go module.
@bflad bflad added the dependencies Pull requests that update a dependency file label May 19, 2024
@bflad bflad added this to the v0.30.0 milestone May 19, 2024
@bflad bflad merged commit 3fde41a into main May 19, 2024
3 checks passed
@bflad bflad deleted the bflad/analysistest-go-mod branch May 19, 2024 18:35
bflad added a commit that referenced this pull request May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant