Golang, Performance, Programming.
anonymous function in the go routine didn’t get any parameters. This caused a data race on both i and j. func createPixel(width, height int) image.Image { m := image.NewGray(image.Rect(0, 0, width, height)) var w sync.WaitGroup w.Add(width * height) for i := 0; i < width; i++ { for j := 0; j <