term

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintColumns

func PrintColumns(wri io.Writer, strs *[]string, margin int)
Example
package main

import (
	"os"

	"github.com/lucasepe/locker/internal/term"
)

func main() {
	items := []string{
		"📂 folder thing",
		"won't get tripped up by emojis",
		"or even color codes",
		"here",
		"are",
		"some",
		"shorter",
		"lines",
		"running out of stuff",
		"foo bar",
	}
	// pass pointer to array of strings and a margin value. this will ensure at least 4 spaces appear to the right of each cell
	term.PrintColumns(os.Stdout, &items, 4)

}
Output:

📂 folder thing                    some
won't get tripped up by emojis    shorter
or even color codes               lines
here                              running out of stuff
are                               foo bar

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL