type go/ast.File
68 uses
go/ast (current package)
ast.go#L1053: type File struct {
ast.go#L1071: func (f *File) Pos() token.Pos { return f.Package }
ast.go#L1077: func (f *File) End() token.Pos {
ast.go#L1092: Files map[string]*File // Go source files by filename
ast.go#L1108: func IsGenerated(file *File) bool {
ast.go#L1113: 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#L253: func FilterFile(src *File, f Filter) bool {
filter.go#L257: func filterFile(src *File, f Filter, export bool) bool {
filter.go#L335: func MergePackageFiles(pkg *Package, mode MergeMode) *File {
filter.go#L494: 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, 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#L208: func NewFromFiles(fset *token.FileSet, files []*ast.File, importPath string, opts ...any) (*Package, error) {
doc.go#L229: goFiles = make(map[string]*ast.File)
doc.go#L230: 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#L546: 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#L175: Files: make(map[string]*ast.File),
parser.go#L2852: func (p *parser) parseFile() *ast.File {
parser.go#L2902: 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#L329: FileVersions map[*ast.File]string
api.go#L482: func (conf *Config) Check(path string, fset *token.FileSet, files []*ast.File, info *Info) (*Package, error) {
check.go#L179: files []*ast.File // package files
check.go#L180: 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#L327: func (check *Checker) initFiles(files []*ast.File) {
check.go#L373: versions = make(map[*ast.File]string)
check.go#L439: func (check *Checker) Files(files []*ast.File) (err error) {
check.go#L460: 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#L82: astFile *ast.File,