wrap

package
v0.0.0-...-9969144 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2025 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lines

func Lines(lines ...string) []string

Lines wraps a slice of strings to a maximum column width. If any of the 'lines' contain newlines, they will be passed through verbatim.

func String

func String(s string) string

String wraps a string to a maximum column width.

func Strings

func Strings(lines ...string) string

Strings wraps a series of strings representing lines to a maximum column width. If any of the 'lines' contain newlines, they will be passed through verbatim.

Types

type Wrapper

type Wrapper struct {
	MaxWidth int
}

func FromTerminal

func FromTerminal(w io.Writer) (*Wrapper, error)

func (*Wrapper) Lines

func (w *Wrapper) Lines(lines ...string) []string

func (*Wrapper) String

func (w *Wrapper) String(s string) string

func (*Wrapper) Strings

func (w *Wrapper) Strings(lines ...string) string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳