pkg

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatCode

func FormatCode(source string) string

FormatCode format code

func RegexpReplace

func RegexpReplace(reg, src, temp string) string

RegexpReplace replace regexp

func SourceText

func SourceText() string

SourceText get source file text

Types

type Source

type Source struct {
	Fset *token.FileSet
	Src  string
	F    *ast.File
}

Source source

func NewSource

func NewSource(src string) *Source

NewSource new source

func (*Source) ExprString

func (s *Source) ExprString(typ ast.Expr) string

ExprString expr string

func (*Source) GetDef

func (s *Source) GetDef(name string) string

GetDef get define code

func (*Source) Packages

func (s *Source) Packages(f *ast.Field) (res []string)

Packages get import packages

Jump to

Keyboard shortcuts

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