Documentation
¶
Overview ¶
Package lang contains all language level utilities.
Index ¶
- Constants
- func Assignable[T any](v any) bool
- func Bool(s *string) (i bool, err error)
- func ComputeIf[T interface{}](expression bool, tf func() T, ff func() T) T
- func Default[T any](v *T, d T) T
- func Dup[T any](v T) *T
- func FormatL(length int, p string, args ...any) string
- func If[T any, V any](expression bool, tf func(T) V, ff func(T) V, arg T) V
- func IsBlank(str string) bool
- func IsLengthLessThen(p *string, l int) bool
- func IsLengthLongerThen(p *string, l int) bool
- func IsRuneCountLessThen(p *string, l int) bool
- func IsRuneCountLongerThen(p *string, l int) bool
- func Join(parts ...*string) string
- func JoinWith(sep string, parts ...*string) string
- func OrDefault[T any](v *T, d *T) *T
- func StringNow() string
- func StringTs(t time.Time) string
- func StringUUID() string
- func Substring(p *string, start int, end int) string
- func Ternary[T any](expression bool, t T, f T) T
- func ToLong[T any](v interface{}, cvt func(*int64) *T, def *T) *T
- func TrimJoin(s string, parts ...*string) string
- type Equal
Constants ¶
View Source
const ( Empty = "" Space = ' ' SpaceString = " " Slash = "/" )
Variables ¶
This section is empty.
Functions ¶
func Assignable ¶
func IsLengthLessThen ¶
func IsLengthLongerThen ¶
func IsRuneCountLessThen ¶
func IsRuneCountLongerThen ¶
func JoinWith ¶
JoinWith concatenates strings from the parts slice, separated by sep. It skips nil pointers in the parts slice.
func StringUUID ¶
func StringUUID() string
Types ¶
Click to show internal directories.
Click to hide internal directories.