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
import "time"
type counter struct {
count []int
}
func main() {
c := counter{}
c.count = make([]int, 2)
go func() {
for i := 0; i < 1000; i++ {
c.count[0] = i
}
}()
go func() {
total := 0
for {
total += c.count[1]
}
}()
time.Sleep(15 * time.Second)
}
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: