SYNOPSYS import "clive/cmd/wr/frmt" const Left = false ... const Esc = "\001" ... const NoBlankLines ParFmt = iota ... func Fmt(wc <-chan []rune, wid int, right bool, keeplines ParFmt) <-chan []rune func Words() (chan<- string, <-chan []rune) type ParFmt int DESCRIPTION CONSTANTS const ( Left = false // left-justify only Both = true // justify both margins ) 1st arg to Fmt const ( Esc = "\001" // start of raw word escape NoEsc = "\002" // end of raw word escape ) Escapes can be used to handle a portion of text as a single word. They are also written to the output and, if used, requires the caller to remove them before presenting data to the user. TYPES type ParFmt int 2nd arg to Fmt const ( NoBlankLines ParFmt = iota // format everything as a single par OneBlankLine // output one empty line between pars AllBlankLines // keep all empty lines between pars ) FUNCTIONS func Fmt(wc <-chan []rune, wid int, right bool, keeplines ParFmt) <-chan []rune Given a chan as the output of Words(), return a chan to read lines from it so that each line is at most n runes wide. This eats most of the white space including empty lines. Justify also the right margin if right is true. If keeplines is true, runs of empty lines are not eated, but replaced with a single empty line. func Words() (chan<- string, <-chan []rune) Given a chan where we send strings, return a chan to get separate words and white-space runs.
Clive, 2nd ed. User's manual. Section 2