package
Version:
v0.3.14
Opens a new window with list of versions in this module.
Published: May 26, 2025
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
判断对象是否为 nil。
与直接使用 `obj == nil` 不同,该函数会正确判断接口类型对象的真实值是否为空。
入参:
出参:
- 如果对象值为 nil,则返回 true;否则返回 false。
func ToPtr[T any](v T) (p *T)
将对象转换为指针。
入参:
出参:
func ToVal[T any](p *T) (v T)
将指针转换为对象。
入参:
出参:
- 返回指针指向的对象。如果指针为空,则返回对象的零值。
Source Files
¶
Click to show internal directories.
Click to hide internal directories.