The highest tagged major version is
v2.
package
Version:
v1.3.16
Opens a new window with list of versions in this module.
Published: Mar 28, 2023
License: Apache-2.0
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
func AssertPointer(ptr interface{}, variableName string) error
AssertPointer 断言是指针
@param ptr 可以为nil,但会断言失败
@param variableName 传参ptr在上一层的变量名
func IsPointer(obj interface{}) bool
IsPointer
e.g.
(nil) => false
func IsPointer1(obj interface{}) bool
IsPointer1
*
- 判断参数obj是否为指针(pointer).
- 参考:github.com/json-iterator/go => reflect.go => func (iter *Iterator) ReadVal(obj interface{})
*
- @param obj nil => false
func IsPointer2(obj interface{}) bool
IsPointer2
e.g.
(nil) => false
func ToString(ptr interface{}) string
ToString 指针 => 指针的地址字符串(十六进制表示,前缀 0x)
e.g.
tmp := 1
(&tmp) => "0xc00000a228"
e.g.1
(nil) => "%!p(<nil>)"
Source Files
¶
Click to show internal directories.
Click to hide internal directories.