util: Ptr() returns itself with uintptr

This commit is contained in:
Edgaru089 2022-02-05 19:25:12 +08:00
parent 9122954e62
commit 05a85ac27f

View File

@ -8,7 +8,7 @@ import (
// Ptr returns the pointer to these things: // Ptr returns the pointer to these things:
// - First element of a slice or array, nil if it has zero length; // - First element of a slice or array, nil if it has zero length;
// - The pointer itself if the parameter is a pointer, pointing to an scalar value. // - The pointer itself if the parameter is a pointer/uintptr, pointing to an scalar value.
// It panics otherwise. // It panics otherwise.
func Ptr(d interface{}) (addr unsafe.Pointer) { func Ptr(d interface{}) (addr unsafe.Pointer) {
if d == nil { if d == nil {