utils

package
v0.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	COLOR_BLACK   string = "\033[30m"
	COLOR_RED     string = "\033[31m"
	COLOR_GREEN   string = "\033[32m"
	COLOR_YELLOW  string = "\033[33m"
	COLOR_BLUE    string = "\033[34m"
	COLOR_MAGENTA string = "\033[35m"
	COLOR_CYAN    string = "\033[36m"
	COLOR_WHITE   string = "\033[37m"

	COLOR_RESET string = "\033[0m"
)

Variables

This section is empty.

Functions

func AskYN

func AskYN(msg string) bool

AskYN asks yes or no until got valid

func AutoPager

func AutoPager(data []byte) error

AutoPager automatically determines whether to use a pager for long output, and outputs it

func ColorSprintf

func ColorSprintf(format string, colorEsc string, a ...any) string

func CreateFile

func CreateFile(fpath string, data []byte) error

CreateFile ensures the top dirs and creates a file

func EnsureDir

func EnsureDir(dir string) error

EnsureDir creates top dirs for a dir

func ErrorPrintf

func ErrorPrintf(format string, a ...any) (int, error)

func Panic

func Panic(msg string, err error, exitcode int)

func WarnPrintf

func WarnPrintf(format string, a ...any) (int, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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