replacer

package
v0.0.0-...-a0b5a8f Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientOption

type ClientOption func(*options)

func IgnoreFolder

func IgnoreFolder(name string) ClientOption

func Logf

func Logf(logf func(string, ...interface{})) ClientOption

func PrintResult

func PrintResult(printResult bool) ClientOption

func RootDir

func RootDir(rootDir string) ClientOption

func UseModules

func UseModules(useModules bool) ClientOption

type File

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

func NewFile

func NewFile(fset *token.FileSet, filePath string) (*File, error)

func (*File) Apply

func (f *File) Apply(fn func(cursor *dstutil.Cursor) bool) dst.Node

func (*File) Fprint

func (f *File) Fprint(w io.Writer) error

func (*File) RewriteImport

func (f *File) RewriteImport(prevPath, newPath string) (rewrote bool)

type Replace

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

func New

func New(prevPath, newPath string, opt ...ClientOption) *Replace

func (*Replace) Run

func (r *Replace) Run() error

Jump to

Keyboard shortcuts

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