Documentation ¶
Index ¶
- Variables
- type Formatter
- type FormatterOptionFn
- func FormatterWithCompanyPrefix(companyPrefix string) FormatterOptionFn
- func FormatterWithDiff(isDiff bool) FormatterOptionFn
- func FormatterWithList(isList bool) FormatterOptionFn
- func FormatterWithStock(isStock bool) FormatterOptionFn
- func FormatterWithVerbose(isVerbose bool) FormatterOptionFn
- func FormatterWithWrite(isWrite bool) FormatterOptionFn
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEmptyPaths = errors.New("empty paths") ErrNotGoFile = errors.New("not go file") ErrGoGeneratedFile = errors.New("go generated file") ErrAlreadyFormatted = errors.New("already formatted") ErrEmptyImport = errors.New("empty import") ErrGoModNotExist = errors.New("go mod not exist") ErrGoModEmptyModule = errors.New("go mod empty module") ErrNotBytesBuffer = errors.New("not bytes.Buffer") ErrNotDSTGenDecl = errors.New("not dst.GenDecl") )
Functions ¶
This section is empty.
Types ¶
type Formatter ¶
type Formatter struct {
// contains filtered or unexported fields
}
stdPackages -> save std packages for later search. moduleNames -> map path to its go.mod module name. formattedPaths -> make sure we not format path more than 1 time.
func NewFormmater ¶
func NewFormmater(opts ...FormatterOptionFn) (*Formatter, error)
type FormatterOptionFn ¶
type FormatterOptionFn func(*Formatter)
func FormatterWithCompanyPrefix ¶
func FormatterWithCompanyPrefix(companyPrefix string) FormatterOptionFn
func FormatterWithDiff ¶
func FormatterWithDiff(isDiff bool) FormatterOptionFn
func FormatterWithList ¶
func FormatterWithList(isList bool) FormatterOptionFn
func FormatterWithStock ¶ added in v0.0.9
func FormatterWithStock(isStock bool) FormatterOptionFn
func FormatterWithVerbose ¶
func FormatterWithVerbose(isVerbose bool) FormatterOptionFn
func FormatterWithWrite ¶
func FormatterWithWrite(isWrite bool) FormatterOptionFn
Click to show internal directories.
Click to hide internal directories.