text

package
v0.0.0-...-040724e Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2019 License: BSD-3-Clause, GPL-2.0, BSD-3-Clause, + 1 more Imports: 3 Imported by: 3

Documentation

Overview

Package text formats strings for printing in a terminal using ansi codes

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Black

func Black(s string) string

Black changes string colour to black

func Blue

func Blue(s string) string

Blue changes string colour to blue

func Cyan

func Cyan(s string) string

Cyan changes string colour to cyan

func Green

func Green(s string) string

Green changes string colour to green

func Magenta

func Magenta(s string) string

Magenta changes string colour to magenta

func PrettyPrint

func PrettyPrint(data interface{}) string

PrettyPrint will return an indented string of an object.

e.g.
[	{
		"Components": {
			"Glucose (g/L)": "150 g/l"
		},
		"Volume": "351 ul"
	},
	{
		"Components": {
			"Magnesium Sulphate (mM)": "50 mM/l"
		},
		"Volume": "210 ul"
	},

]

func Print

func Print(description string, values ...interface{})

Print prints to standard out a string description highlighted in red followed by a values in unformatted text

func Red

func Red(s string) string

Red changes string colour to red

func Sprint

func Sprint(description string, values ...interface{}) (fmtd string)

Sprint returns a string description highlighted in red followed by the values in unformatted text

func White

func White(s string) string

White changes string colour to white

func Yellow

func Yellow(s string) string

Yellow changes string colour to yellow

Types

This section is empty.

Jump to

Keyboard shortcuts

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