state.go
func (r *raftState) goFunc(f func()) {
	r.routinesGroup.Add(1)
	go func() {
		defer r.routinesGroup.Done()
		f()
	}()
}
func (r *raftState) goFunc(f func()) {
	r.routinesGroup.Add(1)
	go func() {
		defer r.routinesGroup.Done()
		f()
	}()
}
func ( r * raftState ) goFunc ( f func ( ) ) { r . routinesGroup . Add ( 1 ) go func ( ) { defer r . routinesGroup . Done ( ) f ( ) } ( ) }
// Start a goroutine and properly handle the race between a routine
// starting and incrementing, and exiting and decrementing.
Start a goroutine and properly handle the race between a routine starting and incrementing and exiting and decrementing .