Documentation ¶ Overview ¶ Package ptr treats pointers as golang's native options. Index ¶ func Filter[T any](tPtr *T, p funcs.Predicate[T]) *T func FilterNot[T any](t *T, p funcs.Predicate[T]) *T func Map[T any, R any](t *T, mapper funcs.Mapper[T, R]) *R func Nil[T any]() *T func None[T any]() *T func Of[T any](t T) *T Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func Filter ¶ added in v0.0.55 func Filter[T any](tPtr *T, p funcs.Predicate[T]) *T func FilterNot ¶ added in v0.0.55 func FilterNot[T any](t *T, p funcs.Predicate[T]) *T func Map ¶ added in v0.0.52 func Map[T any, R any](t *T, mapper funcs.Mapper[T, R]) *R func Nil ¶ added in v0.0.52 func Nil[T any]() *T func None ¶ added in v0.0.52 func None[T any]() *T func Of ¶ func Of[T any](t T) *T Of is useful when one needs a one-liner for pointer of expression result; one needs to understand, the t will be passed as a copy, and `ptr.Of(x)` will result in pointer to copy of x. Types ¶ This section is empty. Source Files ¶ View all Source files doc.go filter.go map.go nil.go of.go Click to show internal directories. Click to hide internal directories.