godebug

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SimplifyStringifyItem = true

Functions

func StringifyItem

func StringifyItem(item debug.Item) string

func StringifyItemFull

func StringifyItemFull(item debug.Item) string

Types

type AnnFileData added in v1.1.0

type AnnFileData struct {
	FileSize int
	FileHash []byte
}

type AnnotationOpt added in v1.1.0

type AnnotationOpt struct {
	Type    AnnotationType
	Opt     string
	Comment *ast.Comment
	Node    ast.Node // node associated to comment (can be nil)
}

func AnnotationOptInComment added in v1.1.0

func AnnotationOptInComment(c *ast.Comment) (*AnnotationOpt, bool, error)

type AnnotationType

type AnnotationType int
const (
	// Order matters, last is the bigger set
	AnnotationTypeNone AnnotationType = iota
	AnnotationTypeOff
	AnnotationTypeBlock
	AnnotationTypeFile
	AnnotationTypeImport  // annotates set of files (importspec)
	AnnotationTypePackage // annotates set of files
	AnnotationTypeModule  // annotates set of packages
)

func AnnotationTypeInString added in v1.1.0

func AnnotationTypeInString(s string) (AnnotationType, string, error)

type Annotator

type Annotator struct {
	// contains filtered or unexported fields
}

func NewAnnotator

func NewAnnotator(fset *token.FileSet, f *SrcFile) *Annotator

func (*Annotator) AnnotateAstFile

func (ann *Annotator) AnnotateAstFile(astFile *ast.File)

type AnnotatorSet

type AnnotatorSet struct {
	FSet *token.FileSet
	// contains filtered or unexported fields
}

func NewAnnotatorSet

func NewAnnotatorSet() *AnnotatorSet

func (*AnnotatorSet) AnnotateAstFile

func (annset *AnnotatorSet) AnnotateAstFile(astFile *ast.File, f *SrcFile) error

func (*AnnotatorSet) InsertDebugExitInMain added in v1.3.1

func (annset *AnnotatorSet) InsertDebugExitInMain(fd *ast.FuncDecl, astFile *ast.File, f *SrcFile)

type Client

type Client struct {
	Conn     net.Conn
	Messages chan interface{}
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, network, addr string) (*Client, error)

func (*Client) Close

func (client *Client) Close() error

func (*Client) Wait

func (client *Client) Wait()

type Cmd

type Cmd struct {
	Client *Client
	Dir    string
	Stdout io.Writer
	Stderr io.Writer

	NoPreBuild bool // useful for tests
	// contains filtered or unexported fields
}

func NewCmd

func NewCmd() *Cmd

func (*Cmd) Cleanup

func (cmd *Cmd) Cleanup()

func (*Cmd) Error added in v1.1.0

func (cmd *Cmd) Error(err error)

func (*Cmd) Printf

func (cmd *Cmd) Printf(format string, a ...interface{}) (int, error)

func (*Cmd) RequestFileSetPositions

func (cmd *Cmd) RequestFileSetPositions() error

func (*Cmd) RequestStart

func (cmd *Cmd) RequestStart() error

func (*Cmd) Start

func (cmd *Cmd) Start(ctx context.Context, args []string) (done bool, _ error)

func (*Cmd) Vprintf added in v1.3.1

func (cmd *Cmd) Vprintf(format string, a ...interface{}) (int, error)

func (*Cmd) Wait

func (cmd *Cmd) Wait() error

type Ctx

type Ctx struct {
	// contains filtered or unexported fields
}

func (*Ctx) SetValue

func (ctx *Ctx) SetValue(vname string, value interface{})

func (*Ctx) Value

func (ctx *Ctx) Value(vname string) (interface{}, *Ctx)

func (*Ctx) ValueBool

func (ctx *Ctx) ValueBool(name string) bool

func (*Ctx) WithBool

func (ctx *Ctx) WithBool(name string, v bool) *Ctx

func (*Ctx) WithValue

func (ctx *Ctx) WithValue(vname string, value interface{}) *Ctx

type ExprIter

type ExprIter struct {
	// contains filtered or unexported fields
}

type File added in v1.3.1

type File interface {
	Filename() string

	Action() FileAction
	// contains filtered or unexported methods
}

type FileAction added in v1.3.1

type FileAction int
const (
	FANone FileAction = iota
	FACopy            // should not be used in fileSrc (need src line references)
	FACreate
	FAAnnotate
	FAWrite // output from struct (ast, modfile struct)
)

type FilePack

type FilePack struct {
	Name string
	Data string
}

func DebugFilePacks

func DebugFilePacks() []*FilePack

type Files

type Files struct {
	// contains filtered or unexported fields
}

Finds the set of files that need to be annotated/copied.

func NewFiles

func NewFiles(fset *token.FileSet, dir string, testMode bool, gopathMode bool, stderr io.Writer) *Files

func (*Files) Add

func (files *Files) Add(filenames ...string)

Add filenames to be solved (can be directories).

func (*Files) Do

func (files *Files) Do(ctx context.Context, filenames []string, env []string) error

func (*Files) NodeAnnType added in v1.1.0

func (files *Files) NodeAnnType(n ast.Node) AnnotationType

type GoMods added in v1.3.1

type GoMods struct {
	// contains filtered or unexported fields
}

type ItemStringifier

type ItemStringifier struct {
	Str            string
	FullStr        bool
	SimplifyResult string
}

type ModFile added in v1.3.1

type ModFile struct {
	// contains filtered or unexported fields
}

func (*ModFile) Action added in v1.3.1

func (f *ModFile) Action() FileAction

func (*ModFile) Filename added in v1.3.1

func (f *ModFile) Filename() string

type ModInfo added in v1.3.1

type ModInfo struct {
	// contains filtered or unexported fields
}

type SrcFile added in v1.3.1

type SrcFile struct {
	// contains filtered or unexported fields
}

func (*SrcFile) Action added in v1.3.1

func (f *SrcFile) Action() FileAction

func (*SrcFile) Filename added in v1.3.1

func (f *SrcFile) Filename() string

type StmtIter

type StmtIter struct {
	// contains filtered or unexported fields
}

type SumFile added in v1.3.1

type SumFile struct {
	// contains filtered or unexported fields
}

func (*SumFile) Action added in v1.3.1

func (f *SumFile) Action() FileAction

func (*SumFile) Filename added in v1.3.1

func (f *SumFile) Filename() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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