From 42022f89d4587eee8132a6c4fc489eb0ec24ae7a Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Wed, 19 Feb 2014 13:28:12 -0500 Subject: [PATCH] go.tools/go/loader: add file missing from rev ebef51b726fc (CL https://golang.org/cl/62540043) TBR=gri R=gri CC=golang-codereviews https://golang.org/cl/65530046 --- go/loader/backdoor.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 go/loader/backdoor.go diff --git a/go/loader/backdoor.go b/go/loader/backdoor.go new file mode 100644 index 00000000000..1a5803b20b1 --- /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 +}