mirror of https://github.com/stretchr/testify.git
Get the modules aware importer via the function that was available in Go 1.11 and earlier
parent
940aba6697
commit
59bec1f2ff
|
@ -4,6 +4,7 @@
|
|||
# automatically or via the GO111MODULE=on environment variable. Codegen only
|
||||
# works with modules, so skip generation if modules is not in use.
|
||||
if [[ -z "$(go env GOMOD)" ]]; then
|
||||
echo "Skipping go generate because modules not enabled and required"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module github.com/stretchr/testify/_codegen
|
||||
|
||||
go 1.13
|
||||
go 1.11
|
||||
|
||||
require github.com/ernesto-jimenez/gogen v0.0.0-20180125220232-d7d4131e6607
|
||||
|
|
|
@ -194,7 +194,7 @@ func parsePackageSource(pkg string) (*types.Scope, *doc.Package, error) {
|
|||
}
|
||||
|
||||
cfg := types.Config{
|
||||
Importer: importer.ForCompiler(fset, "source", nil),
|
||||
Importer: importer.For("source", nil),
|
||||
}
|
||||
info := types.Info{
|
||||
Defs: make(map[*ast.Ident]types.Object),
|
||||
|
|
Loading…
Reference in New Issue