Some golang channel observations
25 Jan 2018
tldr;
Working on an interesting golang tutorial using channels I came to a few helpful conclusions.
Starting Out The particular problem I was solving was a rock-paper-scissors game where I was trying to determine my opponent’s choice and make sure that I would beat them (see this) when we came to the ‘showdown’. There was one channel that was passed to both my ‘player’ function and my ‘opponent’, with which you could send and recieve a struct with a user id along with the choice made: 1-Rock, 2-Paper, and 3-Scissors.
...
Read more...