From 08b5cab875f1a84162bb47773bbe72135135b90e Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Fri, 22 Apr 2022 09:55:19 +0200 Subject: FSM: Make data for transitions optional --- src/fsm.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/fsm.go') diff --git a/src/fsm.go b/src/fsm.go index c51d345..223b42f 100644 --- a/src/fsm.go +++ b/src/fsm.go @@ -119,7 +119,7 @@ func (eduvpn *VPNState) writeGraph() { f.WriteString(graph) } -func (eduvpn *VPNState) GoTransition(newState FSMStateID, data string) bool { +func (eduvpn *VPNState) GoTransitionWithData(newState FSMStateID, data string) bool { ok := eduvpn.HasTransition(newState) if ok { @@ -134,6 +134,10 @@ func (eduvpn *VPNState) GoTransition(newState FSMStateID, data string) bool { return ok } +func (eduvpn *VPNState) GoTransition(newState FSMStateID) bool { + return eduvpn.GoTransitionWithData(newState, "") +} + func (eduvpn *VPNState) generateDotGraph() string { graph := `digraph eduvpn_fsm { nodesep = 2; -- cgit v1.2.3