Documentation ¶
Index ¶
- func GetPointer[T comparable](value T) *T
- func GetSlicePointer[T comparable](value []T) (result []*T)
- func GetStatusPointer(value *uint32) (result *uint8)
- func GetTimeMilliPointer(value *int64) (result *time.Time)
- func GetTimePointer(value *int64, nsec int64) (result *time.Time)
- func GetUnixMilliPointer(value int64) *int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPointer ¶
func GetPointer[T comparable](value T) *T
GetPointer returns pointer from comparable type
func GetSlicePointer ¶ added in v1.0.13
func GetSlicePointer[T comparable](value []T) (result []*T)
GetSlicePointer returns pointer from comparable type slice
func GetStatusPointer ¶ added in v1.0.9
GetStatusPointer returns the status pointer in rpc
func GetTimeMilliPointer ¶ added in v1.3.1
GetTimeMilliPointer returns the time pointer from unix milli time int64
func GetTimePointer ¶ added in v1.0.9
GetTimePointer returns the time pointer from unix time int64
func GetUnixMilliPointer ¶ added in v1.2.4
GetUnixMilliPointer returns nil when int64 is -621355968000, your time should not be from before 1970
Example:
var zeroTime time.Time zeroTimeP := GetUnixMilliPointer(zeroTime.UnixMilli()) fmt.Println(zeroTimeP)
Result: <nil>
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.