Documentation ¶
Index ¶
- type EncoderPressFunc
- type Press
- func (p *Press) I(block func(p2 *Press)) *Press
- func (p *Press) Lines() (lines []line)
- func (p *Press) Ln() *Press
- func (p *Press) P(s string, args ...interface{}) *Press
- func (p *Press) Pl(s string, args ...interface{}) *Press
- func (p *Press) Print() string
- func (p *Press) RandID(prefix string) string
- func (p *Press) RandStr(length int) string
- func (p *Press) SetIndentDelim(s string) *Press
- func (p *Press) SetNewlineStr(s string) *Press
- func (p *Press) SubPress() *Press
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EncoderPressFunc ¶
ref: the reference to the value being encoded.
type Press ¶
type Press struct {
// contains filtered or unexported fields
}
Press is a tool for printing code. Press is not concurrency safe.
func (*Press) I ¶
auto-indents p2, appends concents to p. Panics if the last call wasn't Pl() or Ln(). Regardless of whether Pl or Ln is called on p2, the indented lines terminate with newlineDelim before the next unindented line.
func (*Press) Lines ¶
func (p *Press) Lines() (lines []line)
Returns the lines. This may be useful for adding additional indentation to each line for code blocks.
func (*Press) Ln ¶
Appends a new line. It is also possible to print newline characters directly, but Press doesn't treat them as newlines for the sake of indentation.
func (*Press) SetIndentDelim ¶
func (*Press) SetNewlineStr ¶
Click to show internal directories.
Click to hide internal directories.