MCPcopy
hub / github.com/looplab/fsm / Current

Method Current

fsm.go:208–212  ·  view source on GitHub ↗

Current returns the current state of the FSM.

()

Source from the content-addressed store, hash-verified

206
207// Current returns the current state of the FSM.
208func (f *FSM) Current() string {
209 f.stateMu.RLock()
210 defer f.stateMu.RUnlock()
211 return f.current
212}
213
214// Is returns true if state is the current state.
215func (f *FSM) Is(state string) bool {

Callers 15

TestSameStateFunction · 0.95
TestSetStateFunction · 0.95
TestMultipleSourcesFunction · 0.95
TestMultipleEventsFunction · 0.95
TestCancelWithErrorFunction · 0.95

Calls

no outgoing calls

Tested by 15

TestSameStateFunction · 0.76
TestSetStateFunction · 0.76
TestMultipleSourcesFunction · 0.76
TestMultipleEventsFunction · 0.76
TestCancelWithErrorFunction · 0.76