utils

package module
v0.0.0-...-2fd4e1c Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

README

utils

golang utility

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToString

func BytesToString(b []byte) string

Byte to string, only read-only

func CurrentUsername

func CurrentUsername() string

CurrentUsername returns the username of the current user.

func InListIsExist

func InListIsExist(source string, check []string) bool

Check whether the characters exist in the array

func IsDir

func IsDir(dir string) bool

IsDir returns true if given path is a directory, and returns false when it's a file or does not exist.

func IsExist

func IsExist(path string) bool

IsExist returns true if a file or directory exists.

func IsFile

func IsFile(path string) bool

IsFile returns true if given path exists as a file (i.e. not a directory).

func RandByte

func RandByte(len int) []byte

func RandString

func RandString(len int) string

func SizeFormat

func SizeFormat(size float64) string

func SizeFormatTime

func SizeFormatTime(size float64) string

func StringToBytes

func StringToBytes(str string) []byte

String to byte, only read-only

Types

This section is empty.

Jump to

Keyboard shortcuts

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