added CoalesceDblPtr
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 1m37s
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 1m37s
This commit is contained in:
parent
12fa53d848
commit
a9295bfabf
@ -77,6 +77,14 @@ func Coalesce4Opt[T any](v1 *T, v2 *T, v3 *T, v4 *T) *T {
|
|||||||
return v4
|
return v4
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func CoalesceDblPtr[T any](v1 **T, v2 *T) *T {
|
||||||
|
if v1 != nil {
|
||||||
|
return *v1
|
||||||
|
}
|
||||||
|
|
||||||
|
return v2
|
||||||
|
}
|
||||||
|
|
||||||
func CoalesceString(s *string, def string) string {
|
func CoalesceString(s *string, def string) string {
|
||||||
if s == nil {
|
if s == nil {
|
||||||
return def
|
return def
|
||||||
|
Loading…
Reference in New Issue
Block a user