utils

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDuration

func FormatDuration(duration time.Duration) string

func IsColorEnabled

func IsColorEnabled() bool

IsColorEnabled returns true only when color isn't disabled and we're on a TTY-ish terminal. (Simple heuristic: respect NO_COLOR and require a TERM that usually supports ANSI.)

func NewId

func NewId() string

func Parse

func Parse[T any](s string) (T, error)

func PascalToScreamingSnake

func PascalToScreamingSnake(s string) string

func PrettyJson

func PrettyJson(s []byte) (string, error)

PrettyJson pretty indents your json string

func Stringify

func Stringify(val any) (string, error)

func ToDuration

func ToDuration(s string) (time.Duration, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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