No detection of race condition in `delete` function call

The concurrent write of map may be detected at runtime. However, the delete of map (write operation maybe?) was never detected. The race option does not catch the race condition too. Please take a look at the code below. I’m guessing the lack of race condition in the delete function call is because of the runtime overhead. What kind of reason for this lack of detection in the race condition of the delete function call? Thank you

package main

import (

func main() {
        m := make(map[string]string)
        m["hello"] = "world"
        for i := 0; i < 10000; i++ {
                go func() {
                        delete(m, "hello")
                        // m["hello"] = "world"


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.