gsema icon indicating copy to clipboard operation
gsema copied to clipboard

Run the the example fail

Open figureout opened this issue 2 years ago • 0 comments

i run by copy exmaple code, it print nothing. my go version: go version go1.21.5 linux/amd64 than i change func Read sema.Add(1) to main goroutine inside the for block it run well

···code: userCount := 10 for i := 0; i < userCount; i++ { fmt.Printf("go init func: %d\n",i) sema.Add(1) // move it to here go iRead(i) }

does it matter to go version

figureout avatar Dec 28 '23 04:12 figureout