Back to godoc.org

Package pkg

v0.3.3
Latest Go to latest

The latest major version is .

Published: Jan 20, 2020 | License: MIT | Module: github.com/bilibili/kratos

Index

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

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

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier