package
Version:
v0.5.2
Opens a new window with list of versions in this module.
Published: Nov 1, 2025
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
func Of[T any](value T) *T
Of 将值转换为指向该值的指针
func SliceOf[T any](value []T) []*T
SliceOf 将值切片转换为指针切片
func SliceValue[T any](value []*T) []T
SliceValue 将指针切片转换为值切片
func Value[T any](value *T) T
Value 从指针中获取值,如果指针为nil则返回零值
注意:如果指针为nil,返回的零值可能不是你期望的零值,
例如:*int 为 0,*string 为 "",*bool 为 false 等。
Source Files
¶
Click to show internal directories.
Click to hide internal directories.