Documentation
¶
Index ¶
- Variables
- func AllNils[T comparable](vals []*T) bool
- func CreateFilePathAndWriteJson(path string, jsonData interface{}) error
- func CreateFilePathAndWriteString(path string, str string) error
- func DeleteFileIfExists(relativePath string) error
- func Dump(item any) string
- func FileExists(path string) bool
- func Int64Max(a, b int64) int64
- func Int64Min(a, b int64) int64
- func IntMax(a, b int) int
- func IntMin(a, b int) int
- func IsBlank(str string) bool
- func LoadJson(path string) (interface{}, error)
- func Memoize[T any](f func() T) func() T
- func NotNil[T comparable](val *T, nilProvider func() T) bool
- func NumIsAre(values int) string
- func Pluralize(count int, singular string) string
- func PluralizeCustom(count int, singular string, plural string) string
- func Reverse(str string) string
- func SortedKeys[T any](m map[string]T) []string
- func StrLen(str string) int
- func ToAbsolutePath(path string) string
- func Truncate(str string, maxLen int64) string
- type LoadFileResult
- type Rgb
- type Stack
Constants ¶
This section is empty.
Variables ¶
View Source
var ( PlainF = plain.FprintfFunc() GreenF = green.FprintfFunc() GreenBoldF = greenBold.FprintfFunc() YellowF = yellow.FprintfFunc() CyanF = cyan.FprintfFunc() BoldF = bold.FprintfFunc() PlainS = plain.SprintfFunc() GreenS = green.SprintfFunc() GreenBoldS = greenBold.SprintfFunc() YellowS = yellow.SprintfFunc() CyanS = cyan.SprintfFunc() BoldS = bold.SprintfFunc() )
View Source
var ( IsTty = checkTty() TerminalIsUtf8 = checkTerminalUtf8() )
Functions ¶
func AllNils ¶
func AllNils[T comparable](vals []*T) bool
func DeleteFileIfExists ¶
func FileExists ¶
func NotNil ¶
func NotNil[T comparable](val *T, nilProvider func() T) bool
this is the best way I can think of to do the 'typed nil' check...
func SortedKeys ¶
func StrLen ¶
Simple len(str) call counts bytes, not runes, so e.g. emojis gets counted as multiple characters
func ToAbsolutePath ¶
Types ¶
type LoadFileResult ¶
func LoadFile ¶
func LoadFile(path string) LoadFileResult
Click to show internal directories.
Click to hide internal directories.