diff options
Diffstat (limited to 'src/cmd/vendor/golang.org/x/tools/go/analysis/analysis.go')
-rw-r--r-- | src/cmd/vendor/golang.org/x/tools/go/analysis/analysis.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/analysis.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/analysis.go index 5da33c7e6e..5211773657 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/analysis.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/analysis.go @@ -112,6 +112,19 @@ type Pass struct { // analysis's ResultType. ResultOf map[*Analyzer]interface{} + // ReadFile returns the contents of the named file. + // + // The only valid file names are the elements of OtherFiles + // and IgnoredFiles, and names returned by + // Fset.File(f.FileStart).Name() for each f in Files. + // + // Analyzers must use this function (if provided) instead of + // accessing the file system directly. This allows a driver to + // provide a virtualized file tree (including, for example, + // unsaved editor buffers) and to track dependencies precisely + // to avoid unnecessary recomputation. + ReadFile func(filename string) ([]byte, error) + // -- facts -- // ImportObjectFact retrieves a fact associated with obj. |