Documentation
¶
Overview ¶
Package codewriter is a simple helper for writing out source code.
Index ¶
- type Writer
- func (c *Writer) Body() string
- func (c *Writer) Bytes() []byte
- func (c *Writer) Import(pkgs ...string)
- func (c *Writer) In(fn func(w *Writer))
- func (c *Writer) Indent()
- func (c *Writer) L(format string, args ...any)
- func (c *Writer) Pop() *Writer
- func (c *Writer) Prelude() *Writer
- func (c *Writer) Push() *Writer
- func (c *Writer) String() string
- func (c *Writer) Trailer() *Writer
- func (c *Writer) W(format string, args ...any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
func (*Writer) Body ¶
Body returns the body of the code, without the package declaration and imports.
func (*Writer) Indent ¶
func (c *Writer) Indent()
Indent writes the current indent level without a newline.
Click to show internal directories.
Click to hide internal directories.