Documentation ¶
Overview ¶
Package wrap provides facilities to wrap text
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func String ¶
String is a convenience method that creates a new Wrapper, writes s to it, and then returns the written data. When s has a trailing newline, also adds a trailing newline to the return value.
Example ¶
fmt.Println(String(20, "this text is longer than 20 characters and is wrapped accordingly")) fmt.Println(String(20, " (wrapping also takes leading spaces into account)"))
Output: this text is longer than 20 characters and is wrapped accordingly (wrapping also takes leading spaces into account)
Types ¶
type Wrapper ¶
Wrapper provides methods to write hard-wrapped lines to Writer.
func (Wrapper) WriteIndent ¶
WriteIndent determines the largest space-only prefix of line, and uses it to call WriteLinePrefix().
func (Wrapper) WritePrefix ¶
WritePrefix writes a line with a prefix
Click to show internal directories.
Click to hide internal directories.