You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: