For regular text, injecting newlines when wrapping is the obvious (and only reasonable) choice. However, consider a situation where you're wrapping a shell (or ) command: in such a case, you'll want a , followed by a newline. This pull introduces the argument for that reason. Unfortunately, since Go does not support optional arguments or overloading, this breaks the existing API, but I think it's worth it. The alternative would be to introduce an additional method, but, IMHO, this is less sensible, especially since fixing existing code wouldn't be hard or time-consuming.
Repository: mitchellh/go-wordwrap. Description: A Go (golang) library for wrapping words in a string. Stars: 127, Forks: 18. Primary language: Go. License: MIT. Open PRs: 1, open issues: 0. Last activity: 5y ago. Top contributors: mitchellh, lukecyca, bflad, dtolnay.