Documentation ¶
Overview ¶
Package quickfix provides functions for fixing Go ASTs that are well typed but "go build" refuses to build.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Fset *token.FileSet Files []*ast.File Dir string TypeInfo *types.Info MaxTries int }
Config for quickfix.
func (Config) QuickFix ¶
QuickFix rewrites AST files of same package so that they pass go build. For example:
v declared but not used -> append `_ = v` "p" imported but not used -> rewrite to `import _ "p"` no new variables on left side of := -> rewrite `:=` to `=`
TODO implement hardMode, which removes errorneous code rather than adding
func (Config) QuickFixOnce ¶
QuickFixOnce apply the fixes once.
func (Config) RevertQuickFix ¶
RevertQuickFix reverts possible quickfixes introduced by QuickFix. This may result to non-buildable source, and cannot reproduce the original code before prior QuickFix. For example:
`_ = v` -> removed `import _ "p"` -> rewritten to `import "p"`
type ErrCouldNotLocate ¶
ErrCouldNotLocate represents a file not found error.
func (ErrCouldNotLocate) Error ¶
func (e ErrCouldNotLocate) Error() string
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
goquickfix
The goquickfix command quick fixes Go source that is well typed but go refuses to compile e.g.
|
The goquickfix command quick fixes Go source that is well typed but go refuses to compile e.g. |
Click to show internal directories.
Click to hide internal directories.