Re: [go-nuts] atal error: all goroutines are asleep - deadlock!

2025-05-22 Thread Natxo Asenjo
On Thu, May 22, 2025 at 10:46 AM Jan Mercl <0xj...@gmail.com> wrote: > On Thu, May 22, 2025 at 10:15 AM natxo@gmail.com > wrote: > > > fatal error: all goroutines are asleep - deadlock! > > Something like this? https://go.dev/play/p/4mWJOZd9hgz > This works beautiflly, thanks! So adding the

Re: [go-nuts] atal error: all goroutines are asleep - deadlock!

2025-05-22 Thread thatipelli santhosh
I think need to close errCh, resCh On Thu, May 22, 2025 at 1:44 PM natxo@gmail.com wrote: > hi, > > I do not seem to to get this one to not panic, and do not understand why > yet. > > This code gets the names of files using shell globbing , so go run > testchannels.go dir/* > > This gets th

Re: [go-nuts] atal error: all goroutines are asleep - deadlock!

2025-05-22 Thread Natxo Asenjo
hi, I did not close the other channels, but adding this to the select code seems to fix it: for { select { case err := <-errCh: fmt.Println(err) case data := <-resCh: fmt.Println("from result c

Re: [go-nuts] atal error: all goroutines are asleep - deadlock!

2025-05-22 Thread Jan Mercl
On Thu, May 22, 2025 at 10:15 AM natxo@gmail.com wrote: > fatal error: all goroutines are asleep - deadlock! Something like this? https://go.dev/play/p/4mWJOZd9hgz -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this gr

[go-nuts] atal error: all goroutines are asleep - deadlock!

2025-05-22 Thread natxo....@gmail.com
hi, I do not seem to to get this one to not panic, and do not understand why yet. This code gets the names of files using shell globbing , so go run testchannels.go dir/* This gets the name and size info of all 1000 files in the dire, but panics at the end with a deadlock: fatal error: all