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: https://github.com/golang/go/issues/37054
When this Go module was under heavy development, the analysis testing framework in
golang.org/x/tools
only supportedGOPATH
based resolution. Subsequently, dependencies were vendored and avendor
symlink was placed in each of the test case directories.With recent versions of
golang.org/x/tools
, placing ago.mod
in thetestdata
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.