IsNil¶ func IsNil[T any](ptr *T) bool IsNil checks if a pointer is nil. This is a convenience function for readability. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15package main import ( "fmt" ptr "github.com/Goldziher/go-utils/ptrutils" ) func main() { numPtr := ptr.To(42) var nilPtr *int fmt.Println(ptr.IsNil(numPtr)) // false fmt.Println(ptr.IsNil(nilPtr)) // true }