1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-02-03 13:21:56 +02:00
2022-03-24 20:14:41 +11:00

20 lines
337 B
Go

package lo
// ToPtr returns a pointer copy of value.
func ToPtr[T any](x T) *T {
return &x
}
// ToPtr returns a slice of pointer copy of value.
func ToSlicePtr[T any](collection []T) []*T {
return Map(collection, func (x T, _ int) *T {
return &x
})
}
// Empty returns an empty value.
func Empty[T any]() T {
var t T
return t
}