diff --git a/.travis.gogenerate.sh b/.travis.gogenerate.sh index 5e7ae08..3fc73fe 100755 --- a/.travis.gogenerate.sh +++ b/.travis.gogenerate.sh @@ -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 diff --git a/_codegen/go.mod b/_codegen/go.mod index e810351..31a7e99 100644 --- a/_codegen/go.mod +++ b/_codegen/go.mod @@ -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 diff --git a/_codegen/main.go b/_codegen/main.go index ad0bf25..1daa02d 100644 --- a/_codegen/main.go +++ b/_codegen/main.go @@ -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),