gofile

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoFile

type GoFile struct {
	// path to file that was read
	FilePath string
	// name of package
	PackageName string
	// full file contents
	Body string
	// each func will get its own file
	Fns []PkgPart
	// list of the body of all var/const declarations
	Vars []PkgPart
	// all imports used by this package
	Imports []impt.Impt
	// things declared with "type"
	TypeSpecs []PkgPart
	// abstract syntax tree for the package
	Ast *ast.File `json:"-"`
}

func New

func New(filePath string) (GoFile, error)

func (GoFile) String

func (gf GoFile) String() string

type PkgPart

type PkgPart struct {
	// func/struct/interface/var/const
	Type string
	// name for funcs - blank for others
	Name string
	// the content of this part of the package
	Body string
	// imports used by this package part
	Imports []impt.Impt
}

Jump to

Keyboard shortcuts

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