parse

package
v1.1.52 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2022 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileSet

type FileSet struct {
	Package    string              // package name
	PkgPath    string              // package path
	Specs      map[string]ast.Expr // type specs in file
	Aliases    map[string]ast.Expr // type aliases in file
	Interfaces map[string]ast.Expr // type interfaces in file
	Consts     map[string]ast.Expr // consts
	Identities map[string]gen.Elem // processed from specs
	Directives []string            // raw preprocessor directives
	Imports    []*ast.ImportSpec   // imports
	ImportSet  ImportSet
	ImportName map[string]string
}

A FileSet is the in-memory representation of a parsed file.

func File

func File(name string, unexported bool, warnPkgMask string) (*FileSet, error)

File parses a file at the relative path provided and produces a new *FileSet. If you pass in a path to a directory, the entire directory will be parsed. If unexport is false, only exported identifiers are included in the FileSet. If the resulting FileSet would be empty, an error is returned.

func (*FileSet) PrintTo

func (f *FileSet) PrintTo(p *gen.Printer) error

type ImportSet

type ImportSet map[string]*FileSet

An ImportSet describes the FileSets for a group of imported packages

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL