From 717ed11ee0aa3047bd44193aa18b6ea2f54002c1 Mon Sep 17 00:00:00 2001 From: RGBCube Date: Mon, 10 Apr 2023 22:39:29 +0300 Subject: [PATCH] Rename package to ptr --- README.md | 4 ++-- new.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f02ccfd..afe6316 100644 --- a/README.md +++ b/README.md @@ -17,14 +17,14 @@ func String(ok bool) *string { // s := "Hello, World!" // return &s // You now can do this! - return new.New("Hello, World!") + return ptr.New("Hello, World!") } return nil } func Int32(ok bool) *int32 { if ok { - return new.New[int32](42) + return ptr.New[int32](42) } return nil } diff --git a/new.go b/new.go index 0a96b31..1c75754 100644 --- a/new.go +++ b/new.go @@ -1,4 +1,4 @@ -package new +package ptr // New allocates the thing on the heap and returns a non-nil pointer to it. func New[T any](thing T) *T {