Open tggo opened 7 years ago
Realizing that this issue is several years old and that an answer is probably not relevant to tggo any longer…
If you continue trying to run learn.go it will eventually succeed.
while true; do go run learn.go >/dev/null 2>&1; if [ $? -eq 0 ]; then echo "Learn succeeded after ${i} attempts. "; i=0; else ((i++)); fi; done
Learn succeeded after 2 attempts.
Learn succeeded after 23 attempts.
Learn succeeded after 23 attempts.
Learn succeeded after 25 attempts.
Learn succeeded after 23 attempts.
Learn succeeded after 18 attempts.
Learn succeeded after 6 attempts.
Learn succeeded after 19 attempts.
Learn succeeded after 43 attempts.
Learn succeeded after 1 attempts.
Learn succeeded after 10 attempts.
Learn succeeded after 37 attempts.
Learn succeeded after 7 attempts.
Learn succeeded after 42 attempts.
Learn succeeded after 33 attempts.
Learn succeeded after 1 attempts.
Learn succeeded after 24 attempts.
Learn succeeded after 16 attempts.
Learn succeeded after 16 attempts.
Learn succeeded after 4 attempts.
I'm try run
go run learn.go
and get errorfatal error: concurrent map read and map write
if i change code in learn.go to like this:and remove channels from func worker all working good
Тut with goroutine i catch error Сan you help me sove this problem. I'm just learning, and it is the second program on Go that I run. thanks
ps: go version go1.7.4 darwin/amd64