helper

package module
v0.0.0-...-9a58f6a Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: MIT Imports: 6 Imported by: 1

README

helper

golang helper function

整理一些常用的函数

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileExists

func FileExists(filename string) bool

FileExists Checks whether a file or directory exists

func IsArray

func IsArray(value interface{}, strict ...bool) bool

IsArray Check if the value is an array, the default is non-strict mode Non-strict mode type is SLICE, Array, and map will return true. Returns True when only the array type

func IsPtr

func IsPtr(value interface{}) bool

IsPtr Check if value is a pointer type

func IsSlice

func IsSlice(value interface{}) bool

IsSlice check if value is slice

func SafeMul

func SafeMul(a, b uint) uint

SafeMul Safety multiplication

func StrSizeToBytes

func StrSizeToBytes(sizeStr string) uint

StrSizeToBytes converts strings like 1GB or 12 mb into an unsigned integer number of bytes

func Typeof

func Typeof(value interface{}) (typ string, kind string)

Typeof return the value data type

func Unmarshal

func Unmarshal(data interface{}, v interface{}) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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