utils

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const MaxDigits = 18 // MAX_INT64 ~ 9 * 10^18

Variables

View Source
var Pow10Table = [MaxDigits + 1]int64{
	1, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18,
}

Functions

func Base64

func Base64(str string) string

func Exists

func Exists(name string) bool

func Ext

func Ext(path string) string

func FormatFloat

func FormatFloat(val float64, prec int) string

func FromJSON

func FromJSON(data []byte, v any) (err error)

func GetHostIp

func GetHostIp() string

func Md5

func Md5(str string) string

func MustParseBool

func MustParseBool(s string) bool

func MustParseFloat

func MustParseFloat(s string) float64

func MustParseInt

func MustParseInt(s string) int

func MustParseInt64

func MustParseInt64(s string) int64

func NotZero

func NotZero(v float64) bool

func ParseBool

func ParseBool(s string) (bool, error)

func ParseFloat

func ParseFloat(s string) (float64, error)

func Pow10

func Pow10(n int64) int64

func ToIndentJSON

func ToIndentJSON(v any) byteArray

func ToJSON

func ToJSON(v any) byteArray

func Zero

func Zero(v float64) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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