And chasing that thread leads to this explanation from someone who was in 
the room when the decision was made: 

https://www.reddit.com/r/golang/comments/5tfx7i/comment/ddmo4ug/?context=3

On Sunday, November 30, 2025 at 4:56:56 PM UTC-5 Sean Liao wrote:

> 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/554e4818-92cf-4f1d-bf53-e5d2ed2d4545n%40googlegroups.com.

Reply via email to