#Channel from go routine never closing

5 messages · Page 1 of 1 (latest)

mellow cloak
#

So i have this code: https://github.com/VyrekXD/transfer_data but in the file pkg/utils/utils.go there is a function called handleUrl i call it on cmd/main.go but i never recieve the channel data, u can see that Returning data prints in console but log.Println(len()) doesnt ever show and the for stops i dont know why

burnt jetty
#

Most probably your program is deadlocked

#

Because you're writing to and reading from the same channel on the same goroutine, one of those operations is blocking which means the other operation never starts, and therefore your program is deadlocked.

mellow cloak
#

Ok so in main.go i needed first the err, i was waiting first for the error, but if in the goroutine wasnt an error my code would still wait for err to be declared so it never concludes