TYGoKit

package module
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanStringArray

func CleanStringArray(s []string) []string

Remove empty strings and dedup the string array

func Iif

func Iif(condition bool, trueReturn interface{}, falseReturn interface{}) interface{}

func IntSliceToString

func IntSliceToString(from []int, delim string) string

https://stackoverflow.com/questions/37532255/one-liner-to-transform-int-into-string Converts []int{1, 2, 3, 4, 5, 6, 7, 8, 9} to "1,2,3,4,5,6,7,8,9"

func IntSliceToStringForce added in v1.3.1

func IntSliceToStringForce(from []interface{}, delim string) string

Same as IntSliceToString but takes interface{}, don't do stupid stuff

func PickOneError

func PickOneError(errs ...error) error

Return one of the errors it received or nil if no errors was passed

func ToByte

func ToByte(from interface{}) []byte

func ToDuration

func ToDuration(from interface{}) time.Duration

func ToFloat64

func ToFloat64(from interface{}) float64

func ToInt

func ToInt(from interface{}) int

func ToInt64

func ToInt64(from interface{}) int64

func ToRune

func ToRune(from interface{}) []rune

func ToString

func ToString(from interface{}) string

func TrimLeftChars

func TrimLeftChars(s string, n int) string

Trim left x characters

Types

type CryptoSource

type CryptoSource struct{}

func (CryptoSource) Int63

func (s CryptoSource) Int63() int64

func (CryptoSource) Seed

func (s CryptoSource) Seed(seed int64)

func (CryptoSource) Uint64

func (s CryptoSource) Uint64() (v uint64)

Jump to

Keyboard shortcuts

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