mirror of
https://github.com/RGBCube/GoNew
synced 2025-07-30 00:47:44 +00:00
6 lines
136 B
Go
6 lines
136 B
Go
package ptr
|
|
|
|
// New allocates the thing on the heap and returns a non-nil pointer to it.
|
|
func New[T any](thing T) *T {
|
|
return &thing
|
|
}
|