comment

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractText

func ExtractText(cg *ast.CommentGroup) string

ExtractText extract full text of comment-group

Types

type Lookup

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

func NewLookup

func NewLookup() *Lookup

NewLookup is the factory function creating Lookup

func (*Lookup) LookupAST

func (l *Lookup) LookupAST(filename string) (*ast.File, error)

func (*Lookup) LookupCommentTextFromFunc

func (l *Lookup) LookupCommentTextFromFunc(fn interface{}) (string, error)

LookupCommentTextFromFunc extracts the comment-text of the passed function

func (*Lookup) LookupRegion

func (l *Lookup) LookupRegion(filename string, lineno int, targerName string) (Region, error)

func (*Lookup) LookupRegionFromFunc

func (l *Lookup) LookupRegionFromFunc(fn interface{}) (Region, error)

type Region

type Region struct {
	File   *ast.File
	Name   string
	Lineno int
	// contains filtered or unexported fields
}

func (*Region) Comment

func (r *Region) Comment() *ast.CommentGroup

func (*Region) CommentText

func (r *Region) CommentText() string

func (*Region) LookupDecls

func (r *Region) LookupDecls(name string) []*ast.FuncDecl

Jump to

Keyboard shortcuts

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