lo icon indicating copy to clipboard operation
lo copied to clipboard

feat: add EnsureNotNilPtr

Open vahnrr opened this issue 10 months ago • 0 comments

First of thanks for this library!

While working on math with optional fields generated by go-swagger (e.g. *int) I wrote this EnsureNotNilPtr helper, it's roughly equivalent to this:

ptr = lo.ToPtr(lo.FromPtr(ptr))

If you feel like it belongs here have at it. I'm not fully convinced by the function's name and documentation though, so I'll welcome any suggestions!

vahnrr avatar Apr 10 '25 17:04 vahnrr