-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Closed
Labels
Description
Go version
1.20.8
Output of go env
in your module/workspace:
so sorry i cant provide much infomation, maybe sensitive
What did you do?
sorry i can't upload the complete code, my code invoke (sync.Map).Store method and report an error, read and write the sync.map is concurrent
fatal error: concurrent map read and map write
goroutine 2480 [running]:
sync.(*Map).Swap(0xc015bafdd0, {0x984e080, 0xc013614a50}, {0x9ab49e0, 0xc01235ceb8})
/usr/local/go/src/sync/map.go:353 +0x205
sync.(*Map).Store(...)
/usr/local/go/src/sync/map.go:155
...
What did you see happen?
fatal error: concurrent map read and map write
goroutine 2480 [running]:
sync.(*Map).Swap(0xc015bafdd0, {0x984e080, 0xc013614a50}, {0x9ab49e0, 0xc01235ceb8})
/usr/local/go/src/sync/map.go:353 +0x205
sync.(*Map).Store(...)
/usr/local/go/src/sync/map.go:155
...
What did you expect to see?
how to fix it