The primary use-case for this library was to wrap text for use in console applications. To that end there are two things this library does; wrapping text, and indenting multi-line strings with a given prefix (e.g. for generating help text).
Create a wrapper function and choose your wrapping options (line length, and whether or not to break words onto new lines).
wrapper := wordwrap.Wrapper(20, false)
wrapped := wrapper("This string would be split onto several new lines")
Value of wrapped:
This string would
be split onto
several new lines
Given the primary use-case of this library is for console application text generation, you may want
to take the output of the wrapper and indent that to produce some help text, like this: