utils

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxOutputWidth is the number of spaces to use on a console
	MaxOutputWidth = 72
)

Variables

This section is empty.

Functions

func CPrint added in v1.5.0

func CPrint(text string, style Style)

CPrint prints the text with given formatting style

func CPrintln added in v1.5.0

func CPrintln(text string, style Style)

CPrintln prints the text with given formatting style with newline

func Dash added in v1.4.0

func Dash() string

Dash return dashes with fixed length - 72

func ExitError

func ExitError()

ExitError exit the program with non success code

func ExitWithCode added in v1.3.0

func ExitWithCode(code string)

ExitWithCode exits the current process with specified exit code provided as string

func LongestString added in v1.4.0

func LongestString(list []string) (longest string)

LongestString return longest string from array

func SliceIndex

func SliceIndex(limit int, predicate func(i int) bool) int

SliceIndex find the index of element matching given predicate

Types

type OneBuildColor added in v1.4.0

type OneBuildColor int

OneBuildColor represents type for color enum

const (
	// CYAN is 1build's default color standard
	CYAN OneBuildColor = 0

	// RED is used in failure messages
	RED OneBuildColor = 1
)

type Style added in v1.5.0

type Style struct {
	Color OneBuildColor
	Bold  bool
}

Style represents type for text formatting

Jump to

Keyboard shortcuts

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