type go/ast.File
58 uses
go/ast (current package)
ast.go#L1050: type File struct {
ast.go#L1061: func (f *File) Pos() token.Pos { return f.Package }
ast.go#L1062: func (f *File) End() token.Pos {
ast.go#L1076: Files map[string]*File // Go source files by filename
commentmap.go#L234: case *File, *Field, Decl, Spec, Stmt:
filter.go#L28: func FileExports(src *File) bool {
filter.go#L258: func FilterFile(src *File, f Filter) bool {
filter.go#L262: func filterFile(src *File, f Filter, export bool) bool {
filter.go#L344: func MergePackageFiles(pkg *Package, mode MergeMode) *File {
filter.go#L496: return &File{doc, pos, NewIdent(pkg.Name), decls, pkg.Scope, imports, nil, comments}
import.go#L15: func SortImports(fset *token.FileSet, f *File) {
import.go#L101: func sortSpecs(fset *token.FileSet, f *File, specs []Spec) []Spec {
resolve.go#L74: func NewPackage(fset *token.FileSet, files map[string]*File, importer Importer, universe *Scope) (*Package, error) {
walk.go#L362: case *File:
go/build
build.go#L1366: parsed *ast.File
go/doc
doc.go#L160: func NewFromFiles(fset *token.FileSet, files []*ast.File, importPath string, opts ...any) (*Package, error) {
doc.go#L181: goFiles = make(map[string]*ast.File)
doc.go#L182: testGoFiles []*ast.File
example.go#L27: Play *ast.File // a whole program version of the example
example.go#L50: func Examples(testFiles ...*ast.File) []*Example {
example.go#L152: func playExample(file *ast.File, f *ast.FuncDecl) *ast.File {
example.go#L378: return &ast.File{
example.go#L387: func playExampleFile(file *ast.File) *ast.File {
exports.go#L322: func (r *reader) fileExports(src *ast.File) {
reader.go#L550: func (r *reader) readFile(src *ast.File) {
go/format
format.go#L56: var file *ast.File
format.go#L59: case *ast.File:
format.go#L62: if f, ok := n.Node.(*ast.File); ok {
format.go#L119: func hasUnsortedImports(file *ast.File) bool {
internal.go#L24: file *ast.File,
internal.go#L96: file *ast.File,
go/parser
interface.go#L85: func ParseFile(fset *token.FileSet, filename string, src any, mode Mode) (f *ast.File, err error) {
interface.go#L110: f = &ast.File{
interface.go#L167: Files: make(map[string]*ast.File),
parser.go#L2841: func (p *parser) parseFile() *ast.File {
parser.go#L2884: f := &ast.File{
resolver.go#L21: func resolveFile(file *ast.File, handle *token.File, declErr func(token.Pos, string)) {
go/printer
nodes.go#L1902: func (p *printer) file(src *ast.File) {
printer.go#L1050: case *ast.File:
printer.go#L1070: case *ast.File:
printer.go#L1119: } else if n, ok := node.(*ast.File); ok {
printer.go#L1158: case *ast.File:
go/types
api.go#L414: func (conf *Config) Check(path string, fset *token.FileSet, files []*ast.File, info *Info) (*Package, error) {
check.go#L123: files []*ast.File // package files
check.go#L258: func (check *Checker) initFiles(files []*ast.File) {
check.go#L308: func (check *Checker) Files(files []*ast.File) error { return check.checkFiles(files) }
check.go#L312: func (check *Checker) checkFiles(files []*ast.File) (err error) {
golang.org/x/tools/go/packages
packages.go#L185: ParseFile func(fset *token.FileSet, filename string, src []byte) (*ast.File, error)
packages.go#L365: Syntax []*ast.File
packages.go#L567: f *ast.File
packages.go#L620: ld.ParseFile = func(fset *token.FileSet, filename string, src []byte) (*ast.File, error) {
packages.go#L864: lpkg.Syntax = []*ast.File{}
packages.go#L1100: func (ld *loader) parseFile(filename string) (*ast.File, error) {
packages.go#L1142: func (ld *loader) parseFiles(filenames []string) ([]*ast.File, []error) {
packages.go#L1145: parsed := make([]*ast.File, n)
gotest.tools/v3/internal/source
update.go#L82: astFile *ast.File,