util

package
v0.0.0-...-6312dd6 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSum

func CheckSum(file string, checksum string) bool

func ConditionFunc

func ConditionFunc[T any](c bool, a, b func() T) T

func ConditionValue

func ConditionValue[T any](c bool, a, b T) T

func EnsureDir

func EnsureDir(baseDir string, dirs ...string)

func GenerateMac

func GenerateMac() string

func GetAnyFromPointer

func GetAnyFromPointer[T Valuer](value *T) any

GetAnyFromPointer 传入一个指针,如果指针为空,返回空接口,否则返回指针指向的值

func GetArch

func GetArch() string

func GetNodeVersion

func GetNodeVersion() (version string)

func GetPythonVersion

func GetPythonVersion() (versions []string)

func GetValueFromPointer

func GetValueFromPointer[T Valuer](value *T) T

GetValueFromPointer 传入一个指针,如果指针为空,返回类型的空值,否则返回指针指向的值

func JsonIndent

func JsonIndent(in any) string

func RemoveDir

func RemoveDir(dir string) error

Types

type Valuer

type Valuer interface {
	~string | ~float64 | ~bool | ~int64
}

Jump to

Keyboard shortcuts

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