summaryrefslogtreecommitdiff
path: root/client/fsm.go
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2024-08-22 13:33:19 +0200
committerJeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com>2024-08-22 13:41:58 +0200
commitb3dddce77023fd1d0e5c7451cad97bb88264aa23 (patch)
treeaddce01d61754fbd3e8f73a6e383b7569046b669 /client/fsm.go
parent27cc558c39d47a35b9671aeec7852452d5eb046b (diff)
FSM: Re-ordering and cleanup constructor
Diffstat (limited to 'client/fsm.go')
-rw-r--r--client/fsm.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/client/fsm.go b/client/fsm.go
index 3c2ed80..c8858f9 100644
--- a/client/fsm.go
+++ b/client/fsm.go
@@ -91,7 +91,6 @@ func GetStateName(s FSMStateID) string {
func newFSM(
callback func(FSMStateID, FSMStateID, interface{}) bool,
- directory string,
) fsm.FSM {
states := FSMStates{
StateDeregistered: FSMState{
@@ -168,9 +167,8 @@ func newFSM(
},
},
}
- returnedFSM := fsm.FSM{}
- returnedFSM.Init(StateMain, states, callback, directory, GetStateName)
- return returnedFSM
+
+ return fsm.NewFSM(StateMain, states, callback, GetStateName)
}
// SetState sets the state for the client FSM to `state`