Files
lo/docs/data/core-nil.md
T
2025-10-06 17:15:49 +02:00

524 B

name, slug, sourceRef, category, subCategory, playUrl, variantHelpers, similarHelpers, position, signatures
name slug sourceRef category subCategory playUrl variantHelpers similarHelpers position signatures
Nil nil type_manipulation.go#L34 core type https://go.dev/play/p/P2sD0PMXw4F
core#type#nil
core#type#isnil
core#type#isnotnil
core#type#toptr
core#type#fromptr
1
func Nil[T any]() *T

Returns a nil pointer of type.

lo.Nil[string]()
// (*string)(nil)

lo.Nil[int]()
// (*int)(nil)

Useful when you need a nil pointer of a specific type without declaring a variable first.