Concurrent issue on String() function
youngSSS opened this issue · comments
LouisKim commented
When calling String()
concurrently, it goes to panic.
Is it possible to use sync.Map to avoid panic?
func (sm *StateMachine) stateRepresentation(state State) (sr *stateRepresentation) {
var ok bool
if sr, ok = sm.stateConfig[state]; !ok {
sr = newstateRepresentation(state)
sm.stateConfig[state] = sr // concurrent panic point
}
return
}
Quim Muntal commented
Thanks for reporting, will fix soon.