kratos: github.com/bilibili/kratos/tool/pkg Index | Files

package pkg

import "github.com/bilibili/kratos/tool/pkg"

Index

Package Files

common.go

func FormatCode Uses

func FormatCode(source string) string

FormatCode format code

func RegexpReplace Uses

func RegexpReplace(reg, src, temp string) string

RegexpReplace replace regexp

func SourceText Uses

func SourceText() string

SourceText get source file text

type Source Uses

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

Source source

func NewSource Uses

func NewSource(src string) *Source

NewSource new source

func (*Source) ExprString Uses

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

ExprString expr string

func (*Source) GetDef Uses

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

GetDef get define code

func (*Source) Packages Uses

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

Packages get import packages

Package pkg imports 10 packages (graph) and is imported by 2 packages. Updated 2019-05-17. Refresh now. Tools for package owners.