tools

package
v0.0.0-...-dbcf505 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CancelError = errors.New("CancelError")

CancelError signals user-initiated cancellation

View Source
var SilentError = errors.New("SilentError")

SilentError is an error that triggers exit code 1 without any error messaging

Functions

func Check

func Check(err error)

func CheckDotRenioDir

func CheckDotRenioDir()

func CheckJSError

func CheckJSError(err error, shouldPanic bool)

func DisplayWidth

func DisplayWidth(s string) int

DisplayWidth calculates what the rendered width of a string may be

func Download

func Download(url string)

func FileX

func FileX(file string) string

func Globals

func Globals(ctx *quickjs.Context, this quickjs.Value, args []quickjs.Value) quickjs.Value

func Indent

func Indent(s, indent string) string

func IsUserCancellation

func IsUserCancellation(err error) bool

func LogError

func LogError(scope, format string, a ...interface{})

func LogInfo

func LogInfo(scope, format string, a ...interface{})

func MutuallyExclusive

func MutuallyExclusive(message string, conditions ...bool) error

func Panic

func Panic(err error)

Panic pretty print the error and exit with status code 1

func ReplaceExcessiveWhitespace

func ReplaceExcessiveWhitespace(s string) string

func Truncate

func Truncate(maxWidth int, s string) string

Truncate shortens a string to fit the maximum display width

func TruncateColumn

func TruncateColumn(maxWidth int, s string) string

TruncateColumn replaces the first new line character with an ellipsis and shortens a string to fit the maximum display width

Types

type FlagError

type FlagError struct {
	Err error
}

FlagError is the kind of error raised in flag processing

func (FlagError) Error

func (fe FlagError) Error() string

func (FlagError) Unwrap

func (fe FlagError) Unwrap() error

Jump to

Keyboard shortcuts

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