Re: [go-nuts] Add yield types for range over function

2024-08-21 Thread 'Axel Wagner' via golang-nuts
The plan is, to introduce type-aliases in the `iter` package: type Yield[E any] = func(E) bool type Yield2[K, V any] = func(K, V) bool The reason to make these type-aliases instead of defined types is that it should be possible to define iterators without needing to import the `iter` package. But w

[go-nuts] Add yield types for range over function

2024-08-21 Thread 'lijh8' via golang-nuts
Hi community, The type of yield occurs twice in the function declaration and  at the return statement. ``` func (s *Set[E]) All() iter.Seq[E] {     return func(yield func(E) bool) {         for v := range s.m {             if !yield(v) {                 return             }         }     } }

Re: [go-nuts] any plans to add a go1.23 iterator to sync.Map?

2024-08-21 Thread Diego Joss
It's actually already possible: https://go.dev/play/p/75YYs1R94I2 -- Diego -- 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 golang-nuts+unsubscr...@googlegroups.

[go-nuts] any plans to add a go1.23 iterator to sync.Map?

2024-08-21 Thread Amnon
It would be cool to replace our m.Range() calls with plain for-loops. -- 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 golang-nuts+unsubscr...@googlegroups.com. To

[go-nuts] Re: segmention fault while upgrading from 1.20.6 to 1.22.3

2024-08-21 Thread 'Brian Candler' via golang-nuts
> /root/go/bin/wire-v0.5.0 gen -tags oss ./pkg/server Is it running the binary "/root/go/bin/wire-v0.5.0 " at this point? If so, it would seem to be a bug in that application. Debug as you would any other go program. In particular, try running it under the race detector. You don't give any ref