added DblPtrIfNotNil
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 1m31s

This commit is contained in:
Timo Vetter 2024-06-05 17:53:57 +02:00
parent a9295bfabf
commit fc5803493c

View File

@ -22,6 +22,13 @@ func DblPtr[T any](v T) **T {
return &v_ return &v_
} }
func DblPtrIfNotNil[T any](v *T) **T {
if v == nil {
return nil
}
return &v
}
func DblPtrNil[T any]() **T { func DblPtrNil[T any]() **T {
var v *T = nil var v *T = nil
return &v return &v