Documentation ¶
Index ¶
- func DocString(w io.Writer, f *parser.File, doc *ast.CommentGroup, wrapDocString int, ...)
- func Func(w io.Writer, f *parser.File, fn *parser.FuncDecl, ...)
- func GenDecl(w io.Writer, f *parser.File, decl ast.GenDecl, wrapDocString int, ...)
- func Imports(w io.Writer, f *parser.File, block ImportBlock)
- func Simplify(f *ast.File)
- type ImportBlock
- type ImportGroup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DocString ¶
func DocString(w io.Writer, f *parser.File, doc *ast.CommentGroup, wrapDocString int, lastPos, nextPos token.Pos)
DocString renders a docstring from lastPos to nextPos where lastPos is the end of the previous Decl and next pos is the start of the Decl corresponding to this doc string.
func Func ¶
func Func(w io.Writer, f *parser.File, fn *parser.FuncDecl, tabSize, wrapBody, wrapDocString int, lastPos token.Pos)
Func renders the function fn into w. The function is wrapped so that no line exceeds past the wrap column wrapCol when tabs are rendered with specified tab size.
Types ¶
type ImportBlock ¶
type ImportBlock []ImportGroup
An ImportBlock is a collectino of ImportGroups.
func (ImportBlock) Size ¶
func (b ImportBlock) Size() int
Size returns the number of specs within the import block.
type ImportGroup ¶
type ImportGroup []parser.ImportSpec
An ImportGroup is a collection of related imports. It implements sort.Interface to sort imports by path.
func (ImportGroup) Len ¶
func (ig ImportGroup) Len() int
func (ImportGroup) Less ¶
func (ig ImportGroup) Less(i, j int) bool
func (ImportGroup) Swap ¶
func (ig ImportGroup) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.