https://go.dev/issue/41130

- sean

On Sun, Nov 30, 2025 at 8:36 PM Alexander Shopov <[email protected]> wrote:
>
> Hi all,
>
> Go 1.26 is expected early next year and it contains a change in the semantics 
> of the built-in function `new`. Apart from taking a type, new now can take a 
> literal and return a pointer to a value represented by the literal.
>
> Has there been a discussion (ever) of changing the behavior of the 
> `delete`/`clear` functions so that they can return a boolean indicating 
> whether they actually deleted something?
>
> In some cases it is nice to have an indication whether these functions 
> actually deleted anything.
>
> One can achieve this with an additional line of checking whether the values 
> they act upon contain a particular value (for delete) or any value (for 
> clear). But in a similar way new with literal also saves a single line.
>
> Does that make sense? Is there any interest in such a feature?
>
> Kind regards:
> al_shopov
>
> --
> You received this message because you are subscribed to the Google Groups 
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion visit 
> https://groups.google.com/d/msgid/golang-nuts/CAP6f5MkTiDsq_81r5JbUOkh5g0r74%2B8W2KJGY6BBORvmneuMbA%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/golang-nuts/CAGabyPpTMWOVDcEhWzGeKAj95_A-2Ke65ZLq6hXqDemWUugTnQ%40mail.gmail.com.

Reply via email to