diff --git a/go/loader/backdoor.go b/go/loader/backdoor.go new file mode 100644 index 00000000..1a5803b2 --- /dev/null +++ b/go/loader/backdoor.go @@ -0,0 +1,13 @@ +package loader + +import ( + "go/ast" + "go/build" + "go/token" +) + +// PackageLocatorFunc exposes the address of parsePackageFiles to tests. +// This is a temporary hack until we expose a proper PackageLocator interface. +func PackageLocatorFunc() *func(ctxt *build.Context, fset *token.FileSet, path string, which string) ([]*ast.File, error) { + return &parsePackageFiles +}