textwrap
is a package made to simplify formatting text in a size limited space.
Import the package into your project
import "github.com/sha65536/textwrap"
Wrap a text using Wrap
result, err := textwrap.Wrap("Hello There. General Kenobi.", 12)
Will result in:
Hello There.
General
Kenobi.