lo
lo copied to clipboard
feat: add EnsureNotNilPtr
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!