From 81d42289d714530d8234ab14585eec3464755531 Mon Sep 17 00:00:00 2001 From: Jason Song Date: Tue, 24 Oct 2023 17:32:06 +0800 Subject: [PATCH] docs: update comments --- generic.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/generic.go b/generic.go index 889d6ef..3486ec6 100644 --- a/generic.go +++ b/generic.go @@ -2,12 +2,14 @@ package pt -// P return pointer of v +// P return pointer of v. +// It's a short form of "Pointer" or "GetPointer". func P[T any](v T) *T { return &v } -// V return value of p +// V return value of p. If p is nil, return zero value of T. +// It's a short form of "Value" or "GetValue". func V[T any](p *T) T { if p == nil { return *new(T)