Documentation ¶
Index ¶
- Variables
- func Absolute(_path string) string
- func AssertEmpty[T any](rest []T, message string)
- func AssertNil(i any, message string)
- func AssertOK(condition bool, message string)
- func Atoi(str string) int
- func Base64DecodeOrPanic(s string) []byte
- func Deferred(handler DeferHandler, params ...interface{})
- func Dirname() (string, error)
- func Filename() (string, error)
- func FormatFloat(f float64, precision int) string
- func FromJson(jsonString []byte, v interface{})
- func GetGoContext() context.Context
- func GetType(object interface{}) string
- func HexDecodeOrPanic(s string) []byte
- func HomeResolve(tokens ...string) string
- func IsEmpty[T any](arr []T) bool
- func ItoRunes(i int, runes []rune) string
- func Map[T, V any](array []T, fn func(T) V) []V
- func PaddingLeft(str string, length int, pad rune) string
- func PaddingRight(str string, length int, pad rune) string
- func PanicError(err error)
- func PanicString(err string)
- func ParseFloat(str string) float64
- func PrintError(err error)
- func RandString(length int, letterBytes string) string
- func ReadFile(file string) ([]byte, error)
- func ReadFileOrPanic(file string) []byte
- func RoundFloat(num float64, precision int) float64
- func ToInt(bytes []byte) int
- func ToJson(v interface{}) []byte
- type DeferHandler
- type TimeLong
Constants ¶
This section is empty.
Variables ¶
View Source
var Base64Encode = base64.StdEncoding.EncodeToString
View Source
var HexEncode = hex.EncodeToString
Functions ¶
func AssertEmpty ¶ added in v1.5.3
func Base64DecodeOrPanic ¶ added in v1.5.5
func Deferred ¶
func Deferred(handler DeferHandler, params ...interface{})
func FormatFloat ¶
func FromJson ¶
func FromJson(jsonString []byte, v interface{})
FromJson a wrapper to panic Unmarshal(non-pointer v)
func GetGoContext ¶ added in v1.5.2
GetGoContext used by the initialization
func HexDecodeOrPanic ¶ added in v1.5.4
func HomeResolve ¶ added in v1.5.6
func PanicError ¶
func PanicError(err error)
func PanicString ¶
func PanicString(err string)
func ParseFloat ¶
func PrintError ¶
func PrintError(err error)
func ReadFileOrPanic ¶ added in v1.5.5
func RoundFloat ¶
Types ¶
type DeferHandler ¶
type TimeLong ¶
type TimeLong int64
TimeLong unix nano
func (TimeLong) FromString ¶
func (TimeLong) FromUnixMilliSecond ¶
func (TimeLong) UnixMilliSecond ¶
Click to show internal directories.
Click to hide internal directories.