type go/ast.File
68 uses
go/ast (current package)
ast.go#L1057: type File struct {
ast.go#L1075: func (f *File) Pos() token.Pos { return f.Package }
ast.go#L1081: func (f *File) End() token.Pos {
ast.go#L1096: Files map[string]*File // Go source files by filename
ast.go#L1112: func IsGenerated(file *File) bool {
ast.go#L1117: func generator(file *File) (string, bool) {
commentmap.go#L218: case *File, *Field, Decl, Spec, Stmt:
filter.go#L27: func FileExports(src *File) bool {
filter.go#L256: func FilterFile(src *File, f Filter) bool {
filter.go#L260: func filterFile(src *File, f Filter, export bool) bool {
filter.go#L349: func MergePackageFiles(pkg *Package, mode MergeMode) *File {
filter.go#L508: return &File{doc, pos, NewIdent(pkg.Name), decls, minPos, maxPos, pkg.Scope, imports, nil, comments, ""}
import.go#L16: func SortImports(fset *token.FileSet, f *File) {
import.go#L112: func sortSpecs(fset *token.FileSet, f *File, d *GenDecl, specs []Spec) []Spec {
resolve.go#L77: func NewPackage(fset *token.FileSet, files map[string]*File, importer Importer, universe *Scope) (*Package, error) {
walk.go#L336: case *File:
go/build
build.go#L1432: parsed *ast.File
go/doc
doc.go#L209: func NewFromFiles(fset *token.FileSet, files []*ast.File, importPath string, opts ...any) (*Package, error) {
doc.go#L231: goFiles = make(map[string]*ast.File)
doc.go#L232: testGoFiles []*ast.File
example.go#L28: Play *ast.File // a whole program version of the example
example.go#L51: func Examples(testFiles ...*ast.File) []*Example {
example.go#L153: func playExample(file *ast.File, f *ast.FuncDecl) *ast.File {
example.go#L321: return &ast.File{
example.go#L543: func playExampleFile(file *ast.File) *ast.File {
exports.go#L315: func (r *reader) fileExports(src *ast.File) {
reader.go#L562: func (r *reader) readFile(src *ast.File) {
go/format
format.go#L55: var file *ast.File
format.go#L58: case *ast.File:
format.go#L61: if f, ok := n.Node.(*ast.File); ok {
format.go#L117: func hasUnsortedImports(file *ast.File) bool {
internal.go#L24: file *ast.File,
internal.go#L96: file *ast.File,
go/parser
interface.go#L84: func ParseFile(fset *token.FileSet, filename string, src any, mode Mode) (f *ast.File, err error) {
interface.go#L114: f = &ast.File{
interface.go#L180: Files: make(map[string]*ast.File),
parser.go#L2884: func (p *parser) parseFile() *ast.File {
parser.go#L2934: f := &ast.File{
resolver.go#L21: func resolveFile(file *ast.File, handle *token.File, declErr func(token.Pos, string)) {
go/printer
nodes.go#L1992: func (p *printer) file(src *ast.File) {
printer.go#L1063: case *ast.File:
printer.go#L1083: case *ast.File:
printer.go#L1132: } else if n, ok := node.(*ast.File); ok {
printer.go#L1171: case *ast.File:
go/types
api.go#L337: FileVersions map[*ast.File]string
api.go#L490: func (conf *Config) Check(path string, fset *token.FileSet, files []*ast.File, info *Info) (*Package, error) {
check.go#L183: files []*ast.File // package files
check.go#L184: versions map[*ast.File]string // maps files to goVersion strings (each file has an entry); shared with Info.FileVersions if present; may be unaltered Config.GoVersion
check.go#L332: func (check *Checker) initFiles(files []*ast.File) {
check.go#L378: versions = make(map[*ast.File]string)
check.go#L472: func (check *Checker) Files(files []*ast.File) (err error) {
check.go#L493: func (check *Checker) checkFiles(files []*ast.File) {
golang.org/x/tools/go/packages
packages.go#L203: ParseFile func(fset *token.FileSet, filename string, src []byte) (*ast.File, error)
packages.go#L520: Syntax []*ast.File `json:"-"`
packages.go#L710: f *ast.File
packages.go#L760: ld.ParseFile = func(fset *token.FileSet, filename string, src []byte) (*ast.File, error) {
packages.go#L1033: lpkg.Syntax = []*ast.File{}
packages.go#L1194: FileVersions: make(map[*ast.File]string),
packages.go#L1323: func (ld *loader) parseFile(filename string) (*ast.File, error) {
packages.go#L1373: func (ld *loader) parseFiles(filenames []string) ([]*ast.File, []error) {
packages.go#L1376: parsed = make([]*ast.File, n)
golang.org/x/tools/internal/aliases
aliases_go122.go#L77: pkg, _ := new(types.Config).Check("p", fset, []*ast.File{f}, nil)
golang.org/x/tools/internal/typesinternal
qualifier.go#L18: func FileQualifier(f *ast.File, pkg *types.Package) types.Qualifier {
types.go#L153: FileVersions: map[*ast.File]string{},
golang.org/x/tools/internal/versions
types.go#L15: func FileVersion(info *types.Info, file *ast.File) string {
gotest.tools/v3/internal/source
update.go#L102: astFile *ast.File,