** * Helper function that will deref a pointer if not null * but returns a default value if it is null. */
(x *T)
| 953 | * but returns a default value if it is null. |
| 954 | */ |
| 955 | func SafeDeref[T any](x *T) T { |
| 956 | if x == nil { |
| 957 | var safeOut T |
| 958 | return safeOut |
| 959 | } |
| 960 | return *x |
| 961 | } |
| 962 | |
| 963 | /** |
| 964 | * Utility function for referencing a type with a pointer. |
no outgoing calls
no test coverage detected