fixer

package
v0.35.2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2021 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseFixing

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

BaseFixing implements Fixing.

func (*BaseFixing) Finally

func (f *BaseFixing) Finally() error

Finally writes the fixed content to the file.

func (*BaseFixing) ReplaceText

func (f *BaseFixing) ReplaceText(line int, old, new string)

ReplaceText replaces the text at the line.

type Fixer

type Fixer interface {
	// NOTE: This method is insufficient to process unexpected multi-line contents.
	ReplaceText(line int, old, new string)
}

Fixer provides the ways to operate the proto content.

type Fixing

type Fixing interface {
	Fixer
	Finally() error
}

Fixing adds the way to modify the proto file to Fixer.

func NewFixing

func NewFixing(fixMode bool, proto *parser.Proto) (Fixing, error)

NewFixing creates a fixing, depending on fixMode.

type NopFixing

type NopFixing struct{}

NopFixing does nothing.

func (NopFixing) Finally

func (f NopFixing) Finally() error

Finally noop

func (NopFixing) ReplaceText

func (f NopFixing) ReplaceText(line int, old, new string)

ReplaceText noop

Jump to

Keyboard shortcuts

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