utils

package
v0.0.0-...-72dcd91 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Anyhow

func Anyhow(errs ...interface{}) error

concat multiple strings/errors into a single error

func EnsureDir

func EnsureDir(path string) error

create dir if it does not exist

func EnsureFile

func EnsureFile(path string) error

create file if it does not exist

func Error

func Error(msg interface{}, args ...interface{})

use log.error and exit

func FormatArch

func FormatArch(arch string) (string, error)

format architecture string to app friendly one

func GetDefaultArch

func GetDefaultArch() (string, error)

get default architecture

func GitExists

func GitExists() bool

Wether git is in path or not

func IsAtty

func IsAtty() bool

wether stdout is terminal or not

func Must

func Must[T any](val T, err error) T

panic if err, else return val

func MustB

func MustB[T any](val T, err error) bool

similar to must but returns true always if theres no err. For err it just panics

func ParseColorLevel

func ParseColorLevel(lvl string) bool

wether to allow color or not based on - valid levels: always, auto, never

func PathExists

func PathExists(path string) bool

check if a file exists

func RunGit

func RunGit(suppress bool, args ...string) (int, error)

run git, suppress should be true when we dont want output to show

func SetColor

func SetColor(lvl string)

Set color

Types

This section is empty.

Directories

Path Synopsis
Package for finding directories and files related to the app
Package for finding directories and files related to the app

Jump to

Keyboard shortcuts

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