util

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CastTo

func CastTo(target interface{}, source interface{}) bool

CastTo casting a value to another target, it basically share the same value or uses the same address. A target must be a pointer to be able to receive the value from the source.

func GetAbsPathFromCaller added in v0.3.1

func GetAbsPathFromCaller(skip int) (string, error)

GetAbsPathFromCaller returns the absolute path of the file that calls this function.

func In

func In[T comparable](value T, list ...T) bool

In returns true if a given value exists in the list.

func IsNil

func IsNil(i interface{}) bool

func NewFrom

func NewFrom(in interface{}) (out interface{}, err error)

NewFrom dynamically creates a new variable from the specified data type. However, the returned Value's Type is always a PointerTo{dataType}.

func ReplaceAllEmptySpace

func ReplaceAllEmptySpace(s string) string

ReplaceAllEmptySpace replaces all empty space as well as reserved escape characters such as tab, newline, carriage return, and so forth.

Types

This section is empty.

Jump to

Keyboard shortcuts

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