mitchellh

go-wordwrap

A Go (golang) library for wrapping words in a string.

by mitchellh

Go

Go100%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

2 of 6 standards met

Community profile →
42
✓README✓License○Contributing○Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Quiet · 2 in progress · Last activity 6y ago
See all on GitHub →
jessp01

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.

jessp01 · 6mo ago
ghostsquad

I noticed that there are no tests for special characters, and that the source does convert the string into a rune slice.

ghostsquad · 6y ago
bflad
Add go.modMergedPR

Simple one. 😄 Created via:

bflad · 8y ago
Structured data for AI agents

Repository: mitchellh/go-wordwrap. Description: A Go (golang) library for wrapping words in a string. Stars: 129, Forks: 20. Primary language: Go. Languages: Go (100%). License: MIT. Open PRs: 2, open issues: 0. Last activity: 6y ago. Community health: 42%. Top contributors: mitchellh, lukecyca, bflad, dtolnay.