utils

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommaFormatInt added in v0.0.10

func CommaFormatInt[T Int](input T) string

func IsBinary added in v0.0.4

func IsBinary(data []byte) bool

IsBinary checks if the given byte slice contains binary data by looking for null bytes.

func RandID

func RandID(size int) string

RandID returns a random hex string with the number of characters specified in 'size'.

func TitleCase added in v0.0.8

func TitleCase[T ~string](input T) string

TitleCase is somehow "better" than the deprecated strings.Title. Also handles ~strings.

func ToStrings

func ToStrings[T ~string](input ...T) []string

ToStrings takes a slice of string-like types and returns a slice of strings.

Types

type Int added in v0.0.10

type Int interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64
}

Jump to

Keyboard shortcuts

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