mirror of
https://github.com/RGBCube/GoNew
synced 2025-08-01 09:57:47 +00:00
Docs
This commit is contained in:
parent
1c77137a38
commit
9dc7cb7b36
1 changed files with 1 additions and 0 deletions
1
new.go
1
new.go
|
@ -1,5 +1,6 @@
|
||||||
package new
|
package new
|
||||||
|
|
||||||
|
// New allocates the thing on the heap and returns a non-nil pointer to it.
|
||||||
func New[T any](thing T) *T {
|
func New[T any](thing T) *T {
|
||||||
return &thing
|
return &thing
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue