golang

package
v0.23.3 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Extensions = []string{
	"go",
}
View Source
var NewFile = utils.Cached1In1OutErr(_newFile)
View Source
var PackagesInDir = utils.Cached1In1OutErr(_packagesInDir)
View Source
var ParseGoMod = utils.Cached1In1OutErr(_ParseGoMod)

Functions

This section is empty.

Types

type Config

type Config struct{}

type File

type File struct {
	AstFile   *ast.File
	TokenFile *token.File
	Package   *Package
	AbsPath   string
}

type GoMod

type GoMod struct {
	Module string
}

type ImportStmt

type ImportStmt struct {
	ImportPath string
	ImportName string
}

func NewImportStmt

func NewImportStmt(imp *ast.ImportSpec) ImportStmt

func (*ImportStmt) IsLocal

func (i *ImportStmt) IsLocal(moduleName string) bool

func (*ImportStmt) RelPath

func (i *ImportStmt) RelPath(moduleName string) string

type Language

type Language struct {
	Cfg      *Config
	GoMod    GoMod
	Root     utils.SourcesRoot
	Packages map[string]*ast.Package
}

func NewLanguage

func NewLanguage(dir string, cfg *Config) (*Language, error)

func (*Language) ParseExports

func (l *Language) ParseExports(file *language.FileInfo) (*language.ExportsResult, error)

func (*Language) ParseFile

func (l *Language) ParseFile(path string) (*language.FileInfo, error)

func (*Language) ParseImports

func (l *Language) ParseImports(file *language.FileInfo) (*language.ImportsResult, error)

type Package

type Package struct {
	Name          string
	SymbolToFile  map[string]*File
	AbsPathToFile map[string]*File
}

Jump to

Keyboard shortcuts

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