Please don't use time.After() like it is shown here in the Video (At least you ue an go version below 1.23). Especially in a loop. This is a memory leak, because the timer which is created inside will not be released.
That's definitely true! This was a really simplified example, but you are right. Cleaning up the timer and resetting it would be much more appropriate.
Great video! I have a rudimentary knowledge of channels but I completely overlooked the "select" statement when I was learning them haha, I thought it was just a basic switch.
Please don't use time.After() like it is shown here in the Video (At least you ue an go version below 1.23). Especially in a loop. This is a memory leak, because the timer which is created inside will not be released.
That's definitely true! This was a really simplified example, but you are right. Cleaning up the timer and resetting it would be much more appropriate.
This is my Go to UA-cam channel for all things related to Go
Appreciate it! Thank you :)
Great video! I have a rudimentary knowledge of channels but I completely overlooked the "select" statement when I was learning them haha, I thought it was just a basic switch.
Glad it was helpful! In the end, it's similar to a switch statement, just for channel operations :)